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

Re: Try/Catch Exception Objects: Possible?

Thread Previous | Thread Next
Paul "LeoNerd" Evans
July 23, 2013 19:51
Re: Try/Catch Exception Objects: Possible?
Message ID:
On Tue, 23 Jul 2013 15:04:49 -0400
David Golden <> wrote:

>     catch error::io, error::network {

I'd be quite keen to avoid such things.

Nowwhere else in Perl do we do this sort of handling of code dispatch
based on argument types (except for normal dynamic virtual method
dispatch). One thing I've always liked about Try::Tiny is that
they don't get involved in working out how 'catch' dispatch should work.

We our core 'catch' to have to make such decisions, it suggests a
slippery slope:

 Do we start adding similar logic in other places? Multimethods?

 Does it just use class names? Can we put custom logic in - where{} clauses?

Paul "LeoNerd" Evans
ICQ# 4135350       |  Registered Linux# 179460

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