[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Idea. Removing nils from the language.
- From: Steven Degutis <sbdegutis@...>
- Date: Fri, 9 Jan 2015 11:47:15 -0600
Quoth Udo Schroeter:
> I was on a similar quest, but ended up doing it very differently. In my
> personal dialect, I have disallowed the incidental declaration of global
> variables. Declarations are all local/lexical and assigning a value to an
> undeclared variable is a runtime error. Combined with things that make some
> nil checks superfluous, I'm quite happy with the result.
Why create a Lua dialect for this? In Lua 5.2 and up, you can do this
more simply by creating a new metatable for _G and setting its
__newindex to raise an error.