lua-users home
lua-l archive

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

> hmm,.. interesting, but probably not doable since I have no knowledge
> of what the user wants to do in the script. ( it doesn't have to be a
> function ).

When you load a lua script into the interpreter, it is _always_ loaded as a 
function. Basically, any block of Lua code is a function, including the top 
level one. So, for instance, this script:

function foo()
    -- do something

a = 3

...consists of two functions: the function "foo", and the top level function. 
So yes, this will always work.