[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: local vs global?
- From: PA <petite.abeille@...>
- Date: Tue, 8 Feb 2005 16:26:58 +0100
On Feb 08, 2005, at 14:19, Asko Kauppi wrote:
Have you tried the Lua 5.1 '-w' cmdline flag?
Not yet. But I will now that I know about it :)
It catches all read/write to uninitialized globals, effectively
safeguarding you from using them.
Sounds exactly like what I want.
The only downside I have with it, is that a global being used (set up
by 'rawset') may never, ever, be given 'nil' as a value. Or you're
back in square one. Having a 'global' keyword to declare these would
of course solve the issue.
Lets try:
% lua -w Example.lua
lua: attempt to access undefined variable `LUA_PATH'
stack traceback:
[C]: ?
[C]: in function `require'
Example.lua:6: in main chunk
[C]: ?
'require()' doesn't seem to play well with '-w'... sigh... :/
Cheers
--
PA, Onnay Equitursay
http://alt.textdrive.com/