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

Re: Try/Catch Exception Objects: Possible?

Thread Previous | Thread Next
David E. Wheeler
July 25, 2013 10:26
Re: Try/Catch Exception Objects: Possible?
Message ID:
On Jul 23, 2013, at 12:07 AM, David Nicol <> wrote:

> Have you looked at the way Golang does exceptions? Their documentation discourages
> exception-driven control flow -- everything returns lists, and the convention is to make the second element the completion status, to avoid the out-of-band problem of returning special failure values -- but one could do it with their available tools.

No, but I have used Objective-C quite a bit, and it, too, discourages exception-driven control flow. Still, it has @try/@catch for those situations where it's unavoidable.

> Maybe golang-style panics would be best given their own parallel system, rather than touching the semantics of $@, no matter how slightly.

> In short, I'm opposed to try/catch, as I think it's a tired idiom with superior alternatives, including what Perl's already got.

I think it's fine to have a parallel system, but Perl *already* has exception-driven control flow, and whether or not you or brian d foy prefers a different approach, I think the existing system should be improved.


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