[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Concerns regarding in env do code() end
- From: David Given <dg@...>
- Date: Fri, 15 Jan 2010 00:30:29 +0000
-----BEGIN PGP SIGNED MESSAGE-----
On 14/01/10 23:32, Alexander Gladysh wrote:
> 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.
Actually, what I'd really like is a syntactic construction indicating
that a particular lexical scope has *no* environment and any use of
globals is therefore an error and should error out at compile time.
local a = 1
in nil do
a = 2 -- works
b = 3 -- fails at compile time!
I suspect this is sufficiently Different From The Lua Way not to be
considered applicable for the mainstream language, though (and besides,
the syntax is very ugly). But I'd still like it...
???? ?????????????? ????? http://www.cowlark.com ?????
? "Under communism, man exploits man. Under capitalism, it's just the
? opposite." --- John Kenneth Galbrith
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----