Hi Jon,
> > next = Env.Next; Env.Next = 0;
> >
> > So here 'next' is used.
>
> Not really. A value (from Env.Next) is stored in 'next', but that value is
> never retrieved from 'next' later. Therefor 'next' is considered useless.
Ah! Cool! That's the problem.
'next' is indeed necessary, and the above assignment is correct. The bug
is that this *retrieval* somehow got lost, so nested function calls with
variable arguments (i.e. the '@' mechanism) will unnest properly.
This bug can be produced by nesting two vararg-functions:
(de f @
(g 1 2)
(println (next)) )
(de g @
(println (next)) )
(f 3)
PicoLisp correctly prints 1 and 3, but Ersatz gives a
NullPointerException because 'Env.Next' is never restored when 'g'
terminates.
I'll fix that. Thanks!
♪♫ Alex
--
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe