develooper Front page | perl.perl5.porters | Postings from June 2022

Re: Core exception types [was: Re: Pre-RFC: Improve “wide character” warnings]

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
June 18, 2022 00:20
Subject:
Re: Core exception types [was: Re: Pre-RFC: Improve “wide character” warnings]
Message ID:
ade6a9c9-0071-4b0a-a7a4-e66ffadcb7c5@www.fastmail.com
On Wed, Jun 8, 2022, at 07:12, Paul "LeoNerd" Evans wrote:
> While it is initially tempting to suggest that `catch` would expose
> core-thrown exceptions as objects, there is already a problem here. In
> the past 20-odd years, the $@ variable (and more recently catch) have
> always exposed core-thrown exceptions as plain strings; anything that
> appears as an object must have been some user-thrown object:

I believe you eventually came around to agreeing that this made sense.  "catch ($e)" could get an object in $e, while $@ would remain a string.  (You did this through the creation of a hypothetical ${^EXCEPTION}, but I think it's largely immaterial.)

This likely means that try/catch remain experimental a bit longer, but also seems well worth it to me.

-- 
rjbs
Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About