Ha ha, I never even noticed the valToSymbol function! I went through all the trouble to create a similar function myself called srcName (I also made a ‘srcName’ verb, so that while playing the game I could type “srcName strange object”, and it would display the source symbol for it).
As for executing code from inside the interpreter, I am not exactly sure what you mean… can you give me an example of what you’d like to try to do? After reading your post, I experimented with the DynamicFunction class and came up with this:
#include <dynfunc.h>
#include <dynfunc.t>
DefineLiteralAction(Execute)
execAction() { local dynfunc = Compiler.compile(gLiteral); dynfunc(); } ;
verbRule(Execute) 'execute' singleLiteral : ExecuteAction ;
Now, while playing your game in the interpreter you can type:
> execute ‘function {me.moveInto(creepyValley); me.lookAround(true); }’
and it will happen. Thanks for putting the idea in my head, I think I will find this useful as well!