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

Re: Blessed objects are `isa` their reftype

Thread Previous | Thread Next
From:
Yuki Kimoto
Date:
February 18, 2021 23:42
Subject:
Re: Blessed objects are `isa` their reftype
Message ID:
CAExogxO3ebkVVvL-vfZwuWQ9vN_9oW7rYESgR9VvgPGDbEtz0A@mail.gmail.com
I ask a question at issue.

https://github.com/Perl/perl5/issues/18531#issuecomment-781706180


2021年2月19日(金) 8:33 Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>:

> On Fri, 19 Feb 2021 08:12:30 +0900
> Yuki Kimoto <kimoto.yuki@gmail.com> wrote:
>
> > Sorry, I misunderstanded.
> >
> > perl -e 'print( (bless [], "Foo")->isa("ARRAY")) . "\n"'
> >
> > result is 1.
> >
> > This is originally isa behavior.
>
> Correct; that's how the ->isa method works.
>
> I just don't think that's useful.
>
> It is, at the very least, somewhat surprising. The string "ARRAY" does
> not appear in the @ISA list of package Foo, nor anywhere else. No
> method in such a package would be considered for method dispatch.
>
> --
> 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