Re: stack level parameter
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: stack level parameter
- From: M Joonas Pihlaja <jpihlaja@...>
- Date: 2010年1月21日 13:29:57 +0200 (EET)
On 2010年1月19日, Mark Hamburg wrote:
> This approach does not introduce a stack of environments akin to the
> PostScript dictionary stack. One could build such a stack via
> appropriately constructed environments:
>
> in _G:pushenv( env ) do ... end
[snip]
> But that's a construct built on top of the basic mechanisms.
You left out the stack unwinding with popenv(). Of course you need to
pop it on errors as well, so every pushenv() ought to be called inside
a pcall(). The required error handling makes your approach less
appealing than what your example might suggest.
Cheers,
Joonas