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

Re: [perl #132902] Blead Breaks CPAN: Class::Std

Thread Previous | Thread Next
From:
demerphq
Date:
February 26, 2018 00:14
Subject:
Re: [perl #132902] Blead Breaks CPAN: Class::Std
Message ID:
CANgJU+UDdhd9vf9+W6B_yfRcJU3gCxmm66V0N+oJtXfwJ22Tbw@mail.gmail.com
On 25 February 2018 at 21:28, Father Chrysostomos via RT
<perlbug-followup@perl.org> wrote:
> On Sat, 24 Feb 2018 18:42:22 -0800, demerphq wrote:
>> Isnt mycan slow compared to the internals version? Maybe in modern
>> perls we should expose the internals function Zefram mentioned:
>>
>> (05:57:51) Zefram: annoyingly, the exact thing you want is available
>> as a Perl op, method_named, but you can't get at that op in isolation
>> through Perl source code
>>
>> That way BOTH carp and overload could use it in newer perls.
>
> I’ve just submitted a patch against the UNIVERSAL::can module, making exactly that point: https://rt.cpan.org/Ticket/Display.html?id=124585
>
> (As I mentioned in another message, UNIVERSAL::can is that exposure of the internal function.)

I am really struggling to understand what you think is right.

So first off, there are *two* UNIVERSAL::can()'s involved, the *real*
one, in Perl. And the fake one, in the CPAN module UNIVERSAL-can.

That module thinks that is "buggy" to call UNIVERSAL::can() as a
function, which I definitely do not agree with, and is in fact what I
think Carp should do for this check.

In one of the other posts in this thread, you argue that can()
implementations should not be aware of overload subs, but now you
think the right thing to do is patch a /non-core module/ to be aware
of them.

You also have said you think that UNIVERSAL::can() should not be used
for things like $obj->can("((") because overload subs do not respect
AUTOLOAD. (I don't agree with that either.)

I do not see how it is right that a patch to a module not in core is
required to fix behavior that is in core.

It seems to me that we need an exposure of UNIVERSAL::can() that does
NOT live in the UNIVERSAL namespace and which cannot be overriden by a
module, and that in future Perls we should use that in overload and in
Carp.

I am right now quite baffled.

Honestly at this point I think the right thing is to make Carp load
overload unilaterally and make Carp use that, and move on to more
interesting things.

Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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