[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Variable declaration
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 31 Jan 2002 11:47:24 -0200
>From my understanding of this code, adding this code to the begining of a
>script should be all I need?
Yes. Except that
rawgetglobal(x)
should now be
rawget(globals(),x)
(Sorry, the FAQ needs updating...)
>x = 10
>
>This should cause the function safe_getglobal to be run, because of the
>assignment to global x?
No. It's "get" not "set". Try "print(x)" instead.
For a different technique, see '"Global" keyword' in
http://lua-users.org/wiki/NamespacesAndModules
--lhf