[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Shook's patch and _ENV
- From: Gavin Wraith <gavin@...>
- Date: Sun, 07 Nov 2010 14:26:22 GMT
I appreciate that changing the lexical environment is likely
to be a rare occurrence in programs, and that this justifies
keeping the syntax of _ENV slightly rough-hewn. I have found
very convenient Peter Shook's patch for Lua 5.1 that provided
an expression
local x,y, ... in expr
I find myself frequently using it. In Lua 5.2(w5) it can be expressed as
local x,y, ...
do local _ENV = expr
x,y, ... = x,y, ...
end
What I find clumsy in this is having to repeat the comma separated
list of variables THREE TIMES. That is why I would love to see an
updated version of the patch. Syntactic sugar is sometimes good for
comprehension.
--
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/