[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: local variables and scope
- From: PA <petite.abeille@...>
- Date: Thu, 25 Aug 2005 19:48:41 +0200
On Aug 25, 2005, at 15:18, Roberto Ierusalimschy wrote:
Follows a nice script to detect missing "local" declarations and other
"wrong" uses of global variables.
Simply put it in your path and add require"strict" to your program
(or call "lua -lstrict").
This is very handy, as well as the related 'lua -w' flag.
That said, if you have the misfortune to require a module, you are
toasted:
lua -w Test.lua
lua: attempt to access undefined variable '_NAME'
stack traceback:
[C]: ?
[C]: in function 'module'
.../socket.lua:14: in main chunk
[C]: in function 'require'
Test.lua:10: in main chunk
[C]: ?
Cheers
--
PA, Onnay Equitursay
http://alt.textdrive.com/