This is only tangentially related to this discussion, but I feel it may
affect the Lua-as-language vs Lua-as-configfile line up.
I am curious if it would be worthwhile to implement a perl-style eval() for
executing lua code. Lua's dostring() is very close, but eval() has the added
advantage of automatically returning the last statement executed. So for
instance eval( "10" ) is equivalent to dostring( "return 10" )
I have found this behavior to be especially useful in both scripting
language and config file contexts. In fact, I think we could probably expand
upon it, perhaps deciding on some additional behaviors that perl does not
have. In particular, I think it might be handy for eval() to return a table
of all of the expressions evaluated during the call. So the following two
would be equivalent
foo = eval( "function foo() ... end { a = 1, b = 2 }" )
foo = dostring( "return { function foo() ... end, { ... } }" )
Any thoughts?