lua-users home
lua-l archive

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

On Wed, 2003-10-15 at 04:22, Leandro Candido wrote:
>     How can I access a global variable after a redeclaration as a local? Ex:
>             [global x] = -x -- global x = negative of local x

If you *definitely* mean global rather than "local in enclosing scope"

_G["x"] or just _G.x should do what you want (unless I'm horribly


Daniel Silverstone             
Hostmaster, Webmaster, and Chief Code Wibbler: Digital-Scurf Unlimited
GPG Public key available from       KeyId: 20687895