[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Concerns regarding in env do code() end
- From: Alexander Gladysh <agladysh@...>
- Date: Fri, 15 Jan 2010 02:32:44 +0300
<...>
> in not_present_here do
> a = 1
> end
> will report an error on the assignment line that it attempted to index
> "(environment)" which was nil. Now, while I imagine that someone at some point
> thought "oooh, nil environments would be useful", surely more useful would be
> that the 'in ... do' line cause an error along the lines of "Unable to set
> environment: expected table, got nil" ?
<...>
It is really hard to code serious stuff in Lua without some kind of
global environment protection (like etc/strict.lua). Such protection
would have caught this error. If you do not use one, you should know
what you're doing.
Alexander.