lua-users home
lua-l archive

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


>> But how do I correctly call this not explicitly defined "top level
>> function" containing all code of my script?
>
>You can't, but you can move the same code inside a function and call that
>instead.

In Lua 5.0, you can get the "top level function": it's left on the top of
the stack by lua_load in C and returned by loadfile or loadstring in Lua.
--lhf