lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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!
end

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/

iD8DBQFLT7clf9E0noFvlzgRAvAVAJ4iLCYopH88LqTQFxjEgQS+0johQACg1LVt
FPN4B2Obn8//qU/dAITzO4Q=
=67YB
-----END PGP SIGNATURE-----