lua-users home
lua-l archive

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


> Once you load it, running << chunk = loadfile("filename") >>, Lua
> creates a new function that represents the chunk. Once you call
> that function, running << chunk() >>, it creates two new global
> variables, "a" and "b". If you set "a", "b", and "chunk" to nil (or any
> other value), the three functions are now garbage and are eventually
> collected.

Are you saying that the chunk name I pass in the function lua_load becomes a strong reference to the functions it contains? Does it mean I have to set the loaded chunk name to nil?

Brett