Re: string_exec()
- Posted by katsmeow Mar 06, 2015
- 1849 views
Can a routine be redefined?
Yes.
It seems you can get the same result via routine_id, at a much cheaper cost.
- David
Which is why i suggested it be converted to IL code or compiled or whatever the wizardry du jour is, and the result inlined (or gosub'd) where it was called.
Pronounce "gosub" like "routine_id". Gosub/routine_id means the block of memory where the eval/exec takes place does not need to displace existing code (see http://openeuphoria.org/forum/m/127273.wc), or be rearranged if a max size is allocated (altho it could be alloc'd and free'd, perhaps), and (almost) any header info (such as parameters restricting scope to the location it gosub'd from) can be static at compile time. This is exactly how i did it (except i emulated the gosub with pointer swaps instead of using the stack, for speed reasons).
Kat