What's going on here?
my $foo = bless [], 'foo';
# yep, it's a foo
$foo->isa('foo') and print "it's a foo";
# what about the parent?
$foo->SUPER::isa('foo') and print "Mommy is a foo too";
I suppose it doesn't make much sense to be asking isa() on the superclass, but huh?
Not the Superclass (Score:1)
You're calling the parent's method, but you're still calling it on the child. The invocant doesn't change. Only the starting point for method lookup changes.
Re: (Score:1)
Thanks, chromatic. That did clear up my confusion. I got a bit side-tracked by trying to figure out UNIVERSAL::DOES (and finding practical use for it), but I'll take that to perlmonks.
Thanks also for taking the time to reply in these, uhm, days of peace and celebration. For whatever it's worth, I think you guys are doing great work on Perl 6.
Re: (Score:1)
It's a method intended explicitly for people to override if they support roles/traits. The default implementation falls back on UNIVERSAL::isa, so it answers the DOES question correctly when the how is "through inheritance".