lua-users home
lua-l archive

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


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/