chocolateboy via RT wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=55670 >
>
> It's the "correct" result given that autobox method calls are
> effectively syntactical sugar for:
>
> class($native)->can($method)->($native, ...)
>
> i.e. in this case:
>
> UNIVERSAL::isa(42, 'UNIVERSAL') # undef
>
> Making it throw a -
>
> Can't call method "isa" without a package or object reference
>
> - error for UNIVERSAL methods as though autobox is disabled is
> misleading and inconsistent. What if the user has defined e.g.
> SCALAR::isa? Should we ignore it? Doing magic so that UNIVERSAL method
> calls are diverted to method calls on the class does the wrong thing in
> the case of string invocants as per RT #55565.
>
> What do you suggest?
I think, given the ambiguity, this is fine. Especially once I figured out
that it's normal isa behavior rather than something in autobox. autobox COULD
get clever and say "this can't possibly be a class name so we'll assume you
mean to ask isa() of the autoboxed object" but the hell with it. I'm happy to
say "$thing->isa() always means $class->isa()" and avoid the ambiguity.
I can't say I'm not going to think this is a bad idea a week from now.
Seriously playing with autoboxing dredges up all sorts of weird edge cases.
Anyhow, it can be resolved. I just wanted to get your opinion.
--
52. Not allowed to yell "Take that Cobra" at the rifle range.
-- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
http://skippyslist.com/list/