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

Re: Try/Catch Exception Objects: Possible?

Thread Previous | Thread Next
David Golden
July 25, 2013 13:50
Re: Try/Catch Exception Objects: Possible?
Message ID:
On Thu, Jul 25, 2013 at 7:54 AM, Kent Fredric <> wrote:
> Of course, "dead simple" and "dead simple and also useful" may be 2
> different things.

I think what David is getting at is that we don't have to solve
everything at once.

I'll paste what I said earlier:

It might make sense to split this up into relatively orthogonal chunks:

(1) can we change from core throwing string exceptions to throwing
objects?  (if so, should it be flat or hierarchical)

(2) can we change die to munge strings/references/objects into a
consistent framework?

(3) can we define semantics for a core try/catch/finally/etc construct

> Take this code, which *seems* simple enough that it might work:

That's almost intentionally pathological, though.  And the failure of
existing stacktrace tools on exception objects is an existing problem
in those modules irrespective of a change in core.

> You have to start doing crazy (and expensive in pureperl) things just
> to have a useable exception class if you try using objects.

Like what?  caller() and constructing a proper message that matches the form?


David Golden <>
Take back your inbox! →
Twitter/IRC: @xdg

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