lua-users home
lua-l archive

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


Hi,

Peter Hill:
> So global table allow a sort of 'local' globals for a function? Ie, global
> variable references in a setglobal-ed function have the same scope as
> locals? Sort of do-it-yourself local variables?

"shared do-it-yourself static variables" [..?..] comes closer.  If I
remember correctly, the globals system was designed (a/o) to support
packages consisting of several modules (i.e. script files.)  By sharing a
package-private globals table, these modules can share private data.

Bye,
Wim