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:
Paul "LeoNerd" Evans
Date:
June 8, 2022 14:11
Subject:
Re: Core exception types [was: Re: Pre-RFC: Improve“wide character” warnings]
Message ID:
20220608151117.7a55c46b@shy.leonerd.org.uk
On Wed, 8 Jun 2022 14:06:01 +0200
Branislav Zahradník <happy.barney@gmail.com> wrote:

> > What should we do here?
> >
> >  1) Throw objects of some core-defined type, so `ref` and `blessed`
> > are now true on these things, meaning they can be distinguished -
> >     including by some sort of `isa` test as might someday be added
> > to `catch`, but thus breaking all existing code which inspects $@ or
> >     $e.
> >  
> 
> What about ref == false, blessed == true scenario?

That's not going to work. Don't forget these aren't boolean-returning
functions.. They return the class into which the item is blessed, or
undef if it isn't.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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