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

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

From:
Father Chrysostomos via RT
Date:
August 21, 2012 00:21
Subject:
[perl #62584] Method interpretation in A::B->C
Message ID:
rt-3.6.HEAD-11172-1345533710-1876.62584-15-0@perl.org
On Sat Jan 24 13:32:57 2009, ben@morrow.me.uk wrote:
> 
> Quoth Peter@PSDT.com (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/B.pm (or whatever bit of code it is defines sub
> A::B::C) has even been loaded.
> 
> > aliased.pm 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
https://rt.perl.org:443/rt3/Ticket/Display.html?id=62584



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About