lua-users home
lua-l archive

Re: Lua 5.2 and in-do-end

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


Mark Hamburg wrote:
>
> 	in pushenv( t ) do
IMHO, pushenv should be the default behaviour of in-do-end.
In other words, in-do-end should nest. I think, that would
be the most common use and when handled by the VM, it won't
cost a memory allocation for each in-do-end.
Of course, there has to be a method to tell in-do-env that
searching should not go further up, i.e. a function 'sandbox'
that inhibits further search:
a=1
in sandbox { pr = print, b=2 } do
 pr(a,b,c) --> nil 2 nil
 in { c=3 } do
 pr(a,b,c) --> nil 2 3
 end
end
Ciao, ET.

AltStyle によって変換されたページ (->オリジナル) /