Eval
codeking
Posts: 39
Is there a function like PHP's eval in spin, where it will execute the code on a string?
Comments
Have a look at FemtoBasic (http://forums.parallax.com/showthread.php?p=624225)
for an example of a source level interpreter that runs on the Propeller. The source can be modified to use
floating point rather than integer arithmetic and you could throw out everything except the expression
parser if you only need that. This interpreter compresses keywords. If you're just handling expressions,
you don't really need that either.
something(dothis(hi));
PUB something (function)
(somehow run the function dothis(hi))
See what I'm saying? What that would do would dothis would be run and it's results passed on the something (function). I want the command to do the function to be passed down to something (function)
It is possible to do function pointers, but it's painful and convoluted. Chances are there's an easier way of doing what
you intend.
Eval (if it works like Lisp's eval) seems to be a strange way of passing a function as an argument, but I don't know php so I can't say anymore.