lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


| it has to do something (call exit).  Consider the example from Jim Mathies
| with "longjmp(L->exitJmp, 1);"  What do you want to do if the exitJmp was
| not initialized?  You call abort or exit.  The Lua authors chose exit.

You kick yourself in the head for not initializing it before you run user code. :)

Seriously, Lua is designed for embedded systems right? say your running 
Lua in a digital parking meter, what happens when you call exit() in a 
parking meter? or on the Playstation? I see the exit call in ldo as more of 
a debug break, something that should never happen in "real life" but I 
can't predict what my users will do in their scripts unless I force them into
something, or deal with it.

I'm hoping the setjmp thing will work cleanly in 4.1. We have a situation where 
we do not want to force the user to wrap his code in a predefined function. 
The modifications are so small, it takes seconds to make the change.
If it doesn't work, spec'ing out a "start" or "run" function the user has to 
define and calling it by lua_call is the alternative. But this is very, "java'ish" 
so I'm hoping to avoid it. :)

Regards,
Jim