lua-users home
lua-l archive

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


> As I understand it when you load a file or string you compile the chunk
> into a function which is then called to evaluate the code in the chunk.

load (and friends) just does that: loads the chunk and compiles it
into a function. If you don't save or use the result, it'll be garbage
collected.

> question is where is the function stored?

It is stored where you tell Lua to. If you use it immediately, it'll be
stored temporarily in a VM register and eventually be collected.