Re: string_exec()
- Posted by katsmeow Mar 05, 2015
- 2260 views
Tiggr, what is 5 + 4?
It's pretty easy to write a string_exec() routine that does this:
string_exec("5+4")
Since Euphoria can see it's own variables and values (trace does this), it should be straight forward to do this as well:
string_exec("5+4-myVariable")
Well, except the programmer cannot see the var table. If you ask for the value of myVariable, it's more likely to crash because the var doesn't exist.
And since Euphoria can see user defined functions, it's not hard to extend string_exec to be able to this as well:
string_exec("5+4-myRoutine(myVariable)")
You can of course put anything in the string, that doesn't mean it gets converted to IL code and executes in the scope of where it was called.
Is this what you're asking for? If so, it's a lot simpler than the solutions that have been proposed.
- David
Show us. I'll pause taking Tiggr apart for a lil while, to see what you come up with.
Kat