Hi,
I'm trying to use the Expression class but it seems the examples given in the documentation are off.
For example this does not compile ("can't find "run" function with 4 arguments in class Expression"):
Expression e1 = new Expression("
{
int a,b,c,d;
return a + b + c + d;
}
","a,b,c,d");
if(e1.isCompiled()) {
log.message("%s\n",typeinfo(e1.run(1,2,3,4)));
}
To give you some context, I'm trying to use this to run unit tests on our project. The Expression class seemed to be a good way of doing it since it's supposed to allow expressions written in strings to be processed at run time. This way we could easily display which test went wrong. It works for simple tests using static methods but I wish I could run the expressions with arguments. If it's not possible, do you know any better way to evaluate and display a boolean expression ? Thanks !