This project has moved and is read-only. For the latest updates, please go here.

Getting evaluation of intermediate ast nodes

Jul 26, 2013 at 9:08 AM

First of all, I love Irony and I found it very easy to use.
Basically I have the following:
x = normal(0,1)  
y = uniform(0,5) // custom functions defined to return normally or uniformly distributed random numbers
f = x * y // just an example
In my small app I want to be able to run that formula for say 100 times in order to generate an artificial dataset with x,y,f.

So my question is, besides the actual evaluation of f, is there any way to also get the values of x and y? I tried inspecting the ast node in debug mode but could not find where such a value is stored.

Thank you,
Jul 26, 2013 at 7:43 PM
well, not clear what does 'get the values of x and y' mean exactly? See the values in VS debugger when you stop somewhere? If this is what you want, then Ast node is not the place. A running program has 2 segments - code and data. AstNode at runtime is 'code', while data is stored in the stack of scopes/frames - available in execution context. Look there for the values, but note that they are stored in plain object arrays (not dictionaries).
Jul 26, 2013 at 9:19 PM
Thank you for your answer, that was exactly what I meant. I will look around for the execution context but in the mean time I was able to retrieve the values from the dictionary evaluator.App.Globals.