[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [5.1.4/newbie] "attempt to index ... 'file' (a nil value)"?
- From: Alex Bradbury <asb@...>
- Date: Fri, 18 Feb 2011 20:04:44 +0000
On 18 February 2011 19:32, Steve Litt <slitt@troubleshooters.com> wrote:
> This is wonderful. It's like "use strict" for Lua. However, I had a problem
> with your code because k was always a table, regardless of the global I read
> or wrote (I also added a __newindex() to catch writes to globals). So I
> changed your code to add a v to the __index() and __newindex() args, and it
> seems now to do what you intended:
See also http://lua-users.org/wiki/DetectingUndefinedVariables
Alex