lua-users home
lua-l archive

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


Hi,

> Wim Couwenberg:
>> Note that not only closure upvalues play a role in this,
>> but the function environment (the former "local global
>> table") as well.

> Peter Hill:
>> I'm not quite sure what you mean. Could you explain that
>> a bit? Or maybe add an explanation to the Wiki
>> "MinimisingClosures"?

Closures created from the same function prototype are not
only parameterized by their upvalues but also by their
function environment (the "globals.")  This environment may
vary (and be individually adjusted!) for such closures.  In
this case closures can not safely be "reused."

Bye,
Wim