On Sat, Sep 13, 2008 at 09:09:58AM -0400, Will Coleda wrote:
> > --- trunk/include/parrot/exceptions.h   (original)
> > +++ trunk/include/parrot/exceptions.h   Fri Sep 12 21:05:37 2008
> > @@ -87,7 +87,8 @@
> >         CONTROL_OK,
> >         CONTROL_BREAK,
> >         CONTROL_CONTINUE,
> > -        CONTROL_ERROR
> > +        CONTROL_ERROR,
> > +        CONTROL_TAKE
> >  } exception_type_enum;
> 
> Tcl can currently deal with OK, CONTINUE, BREAK, ERROR, and RETURN.
> 
> What's TAKE?

TAKE is like CONTROL_RETURN except that it signals that we expect
execution to continue after the point of the TAKE.  It's quite
similar to a .yield operation for coroutines.

Speaking of exception type names, I have a question about
CONTROL_BREAK and CONTROL_CONTINUE.  An interesting artifact
of Perl 6 is that it has "break" and "continue" keywords, but
they don't apply to looping constructs the way that "break"
and "continue" do in other languages.  (The Perl analogues of
C's "break" and "continue" are "last" and "next".)

I know that we're explicitly not trying to make Parrot directly 
follow Perl's models, but perhaps the rationale for having Perl 
(both 5 and 6) choose next/last instead of the traditional
break/continue might be applicable to Parrot nomenclature as well.
So, perhaps CONTROL_BREAK and CONTROL_CONTINUE should really
be CONTROL_NEXT and CONTROL_LAST (and we may also want a
CONTROL_REDO in there somewhere also).

Pm

Reply via email to