Tim Bunce <[EMAIL PROTECTED]> wrote:

> I guess the HLL compiler needs to ensure that for every push the
> control flow will always pass through a matching pop.

Not necessarily. The handler is pushed onto the control stack. During a
context change (e.g. from a subroutine return), the previous context
with the according control stack top is copied into the interpreter.
So effectively the handler is discarded.

OTOH if several handlers are involved the emitted code ought to take
care of it, yes.

> Couldn't (doesn't) parrot have a stronger concept of a 'scope' (as
> in perl5's scope.c) so that scope-exit cleanup can be automated and
> reliable?

AFAIK a scope is either a lexical closure or optimized (maybe) to a
region of code surrounded by C<new_pad> / C<pop_pad> opcodes. Doing the
rught thing on scope exit is up to the emitted code.

> Tim [ignore me if I'm talking nonsense]

leo

Reply via email to