[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Redefining functions
- From: Ben Sunshine-Hill <bsunshin@...>
- Date: Sat, 28 Sep 2002 20:47:15 -0700
> 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
end
a = 3
foo()
...consists of two functions: the function "foo", and the top level function.
So yes, this will always work.