[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: a new proposal for environments
- From: David Given <dg@...>
- Date: Thu, 25 Feb 2010 12:21:01 +0000
On 2010-02-25 00:53, Nevin Flanagan wrote:
[...]
Does this mean that you can supply any value to _ENV, as long as it provides __index and __newindex metamethods as required?
Hmm. If I'm *not* using globals, can I assign nil to _ENV to get runtime
errors if I tyop the name of a local?
local string_len = string.len
_ENV = nil
a = 5 -- oops, forgot to local this
Is there any chance of a facility to produce *compile* time errors if my
code tries to reference globals? It would have to be possible to turn it
on halfway through a chunk, once I'd finished loading locals from the
global table (as in the example above).
This would be invaluable for large programs; tracking down typo'd
variable names is a suprisingly large portion of my debugging time.
--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ life←{ ↑1 ⍵∨.^3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵ }
│ --- Conway's Game Of Life, in one line of APL