On Fri, Nov 19, 2004 at 09:59:18AM +0100, Leopold Toetsch wrote:
: Allowing just one additional object doesn't properly support Python,
: which has two optional expressions for the C<raise> statement and Python
: attaches a traceback object to the exception.
: 
: OTOH (again from Python's view) raising just a C<StopIteration> or a
: C<KeyErrror> ought to be fast as its used heavily.

And Perl 6 would like control exceptions to be fast.  We won't use
ordinary exceptions as heavily as Python does for normal control flow,
since we believe in undef.  Or rather, we'll generate exceptions,
but instead of throwing them we'll often just stuff them into an
undef and return that.

: And Python has an hierarchy of exception *objects*, with inheritance. So
: I think that for maximum flexibility we should just have exception
: objects, with some mandatory attributes (the exception class might
: already provide enough information) and additional information the HLL
: might stuff in.
: 
: How will Perl6 do it?

Same as Python, to the first approximation.  See

    http://dev.perl.org/perl6/synopsis/S04.html

which is up-to-date as of Saturday.

In fact, all the synopses on dev.perl.org are pretty much up-to-date
at this point.  Any implementor that cares to should probably
take a pass through them all (if they haven't done so recently)
and look for any show-stoppingly unimplementable ideas, or even any
ideas that punish the innocent with the guilty, performance-wise.
(Ignoring the bullets we've already irrevocably bit, like MMD.)

Larry

Reply via email to