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

Re: PSC #024 2021-06-11

Thread Previous | Thread Next
From:
mah.kitteh via perl5-porters
Date:
June 14, 2021 04:08
Subject:
Re: PSC #024 2021-06-11
Message ID:
-ylzj47SZkVOYsWkEHQV4OaI1ugMX4SBvs4AluX9tVNp38mROx7uW5N8TiIfk8im_A4CxrLdDbI6eTR4s4Q_RQ5oWe2i-SUOwxpCdmxf9GA=@protonmail.ch
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Sunday, June 13th, 2021 at 7:50 PM, Yuki Kimoto <kimoto.yuki@gmail.com> wrote:

> 2021-6-13 18:02 Neil Bowers <neilb@neilb.org> wrote:
>
>> When does `isa` stop being experimental?
>> We talked about "isa", which is currently experimental[5]. I asked what the criteria are for dropping the experimental from this? Perlpolicy says 2 stable releases and 1 release cycle with no design-changing bugs[6]. We think "isa" looks good, but has it been used, and seriously abused with all sorts of weird edge cases? Probably not. Nick will put together a list of ways to abuse interfaces in Perl, which we're hoping might end up somewhere in pod/, and which we’ll use to exercise isa a bit more.
>
> I would like application users to try the isa operator to make it more reliable. That's because CPAN can't check for isa bugs.

Can you explain to me why I should want to use it?

E.g., what's the advantage of "isa" over "ref", other than the it being infix? Even with Sub::Infix, I can do something like this:

use strict;
use warnings;
use Sub::Infix;
BEGIN {
*isa = infix { ref $_[0] eq $_[1] }
}
my $foo = bless {}, 'Foo';
if ($foo |isa| 'Foo') {
print qq{isa Foo ok\n};
}
else {
print qq{isa Foo not ok\n};
}
$foo = bless {}, 'Bar';
if ($foo |isa| 'Foo') {
print qq{isa Foo ok\n};
}
else {
print qq{isa Foo not ok\n};
}

So there seems to be 2 issues this is "solving":

a. a "deep" "ref" check (all the way up and down @ISA?)
b. dealing with the fact that what's being checked is not a reference and therefore has no access to UNIVERSAL::isa?

I just happened to find this when doing some "fact checking"; does this infix "isa" address the shortcomings of UNIVERSAL::isa?

https://stackoverflow.com/questions/204316/why-shouldnt-i-use-universalisa#204368

I also found the original GH issue, https://github.com/Perl/perl5/issues/17200 and I can't seem to find the answer to my questions.

Is there a good perldoc I can read about it so I know what to generally expect and what its proper uses cases are? I can't seem to find that. I did look.

Cheers,
Brett

> I would like to send a message to Perl users who are interested in the new grammar and receive any problem reports about isa operator.
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