develooper Front page | perl.perl5.porters | Postings from July 2013

Re: Try/Catch Exception Objects: Possible?

Thread Previous | Thread Next
Tom Christiansen
July 26, 2013 00:23
Re: Try/Catch Exception Objects: Possible?
Message ID:
> On Thu, Jul 25, 2013 at 6:13 AM, David E. Wheeler <> wrote:

>>> I don't know if a stack is really needed, a localizable
>>> $THROWN_PANIC might be enough.
>> I don’t understand. What is $THROWN_PANIC? If it is an exception
>> object, why would it not need a trace?
>> I nearly always want a trace for my exception objects. The idea, for
>> me, is such exceptions should be unexpected and reported to the
>> developer, who will likely need the stack.

> by "stack" here I meant more than one active exception at the same
> time, possibly living in @@. I did not intend to allude to traces.

> $THROWN_PANIC is a placeholder for the new single thing that is not
> $@.

Panicking is a good name for it.  I always use panic() in my code; 
I'm used to it.  Plus it's part of go's defer/panic/recover model.

However, I've always thought it would be kind cool if one could throw 
instead of exceptions, *tantrums*. :)


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About