develooper Front page | perl.perl5.porters | Postings from January 2021

Re: Adding a try/catch syntax to Perl

Thread Previous | Thread Next
Paul "LeoNerd" Evans
January 22, 2021 19:09
Re: Adding a try/catch syntax to Perl
Message ID:
On Fri, 22 Jan 2021 13:47:52 -0500
Dan Book <> wrote:

> The parentheses also enable future extensions with arbitrary syntax
> such as typed dispatch.

^-- yes, that.

I have been thinking several steps ahead here. While not a part of my
*current* proposal for core, I do aim that one day we can

  try { ... }
  catch ($e isa MyApp::SomeWeirdException) { ... }
  catch ($e isa Perl::X::ENOENT) { ... }
  catch ($e) { default here }

So the parens are necessary for those later forward steps.

If you want to see the full and varied discussions about the history of
that part of Syntax::Keyword::Try, see [while is still a

Paul "LeoNerd" Evans      |  |

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