This project is read-only.

About Calling Functions

Jul 10, 2009 at 8:49 AM


    I am new to DLR and I am having problem in calling function

I building a calculator which I've added functions support recently the problem simply is that when I parse the function body it takes the function expression in the new function not a reference for it.


Qs> f(x) = x^2

Qs> g(x) = f(x)/x

Qs> f(x) = x


A) so if you called g(x) again it will hold the old expression of f(x) {which is wrong}

        actually I've tried to read about CallSiteBinders and no luck (I can't understand)

       its like ByVal expression not ByRef  :)  how to call byRef

B) This will lead me to another question about recursive functions and how to implement them

        - do all functions in DLR only Lambda functions (I mean concept itself) am I missing something here??

C) I am using Scope object that was sent by the Language Context to store variables  {did I miss something here ??}

          -  because I saw in some implementations people make Big lambda function that hold the program inside it

D) Hosting by subclassing ConsoleHost doesn't work in Mono  and the TextReader that should give me the code is always null. {I had to make a  workaround}


Thank you

Ahmed Sadek



Jul 11, 2009 at 2:55 PM

ok the problem solved now Thanks for the recursive post that was before me :)   

Calling LambdaExpression recursively