lua-users home
lua-l archive

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


The Wiki at http://lua-users.org/wiki/EnvironmentTables says:

"Newly created closures (and userdata) acquire their environment
tables from the currently executing closure, if there is one, and
otherwise from the current thread. "

Should this read

"Newly created closures (and userdata) have their environment
tables set to the currently executing closures environment table,
if there is one, and otherwise to the environment table of the
current thread when the closure is executed."

My point being that I think it can be confusing (I get confused)
about when the environment table is aquired.

More simply stated, is it true : if a closure has an environment
table set then any closures that the executing closure creates
will inherit the environment table of the executing closure".

Or have I got it wrong?

David Burgess