lua-users home
lua-l archive

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


On Thu, 29 Mar 2012 23:02:44 +0200
Petite Abeille <petite.abeille@gmail.com> wrote:

> 
> On Mar 29, 2012, at 9:56 PM, Steve Litt wrote:
> 
> > So here's what I did…
> 
> Alternatively:
> 
> % lua -l strict Test.lua
> 
> lua: Test.lua:1: variable 'bar' is not declared
> stack traceback:
> 	[C]: in function 'error'
> 	./strict.lua:37: in function '__index'
> 	Test.lua:1: in main chunk
> 	[C]: in ?
> 
> In other words, don't require strict in your code, but instead load
> it when appropriate during your development cycle, courtesy of lua -l.

Yes, that's another way. You'd still need to put the correct
version of strict.lua where your Lua program can find it.

I prefer the require method because, knowing me, I'd forget to include
the -l, and then I'd make some bozo error with an unintended global.

SteveT