Hi,

I'm trying to figure out the best way to embed IP 2 expressions into C# to implement the following: I have given a scope that consists of an IList<object> and a mapping of the list's indices to a name.
Now I want to evaluate several expressions within this scope.
After this, the scope changes, but the mapping stays the same, only the IList changes. Then again the expressions are evaluated.

What is the right way to do it?

// Input
IEnumerable<IList<object>> data = ...
IList<string> names = { "a", "b", "c" };
IList<string> pyexpressions = { "a+b", "sqrt(b*c)" };

// expected Output
delegate object MyEval(IList<object> row);
IList<MyEval> expressions;

// IP 2 magic
// ???

// Calculate
foreach(IList<object> row in data)
  foreach(MyEval expression in expressions)
    object obj = expression(row);
    // ...


Thanks,
Christian
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to