develooper Front page | perl.perl5.porters | Postings from August 2012

[perl #62584] Method interpretation in A::B->C

Father Chrysostomos via RT
August 21, 2012 00:21
[perl #62584] Method interpretation in A::B->C
Message ID:
On Sat Jan 24 13:32:57 2009, wrote:
> Quoth (Peter Scott):
> > I don't see why it wouldn't be an improvement to resolve in the other 
> > priority order; i.e., if A::B::C is defined, call that, else call A::B.
> I don't think that's possible, firstly because you don't necessarily
> know which methods a class defines (consider AUTOLOAD), and secondly
> because the choice between A::B()->C and "A::B"->C is made at compile
> time, possibly before A/ (or whatever bit of code it is defines sub
> A::B::C) has even been loaded.
> > would still work
> ...provided you don't define any methods in the package you are aliasing
> into. The big advantage of aliased (indeed, the only thing that makes it
> remotely sane) is that its effect is package scoped, so any code
> compiled into the package you imported the alias into will use the
> alias, and any other code will completely ignore it.

I think that is sufficient reason to reject this ticket.  This could
never work as proposed, and would break existing code.


Father Chrysostomos

via perlbug:  queue: perl5 status: open Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About