develooper Front page | perl.perl5.porters | Postings from September 2011

Re: Package:: still ambiguous

Thread Previous | Thread Next
September 14, 2011 09:02
Re: Package:: still ambiguous
Message ID:
Stevan Little wrote:
>How do you handle inheritance?

Put package object ref into @ISA.  @ISA would be one of many places
where a package can be referenced either by name or by object ref,
like the second argument to bless().

>My (limited) understanding of the mro functionality is that it is still
>very tied to string lookup for package names.

That can change.  However, with the concept of weak-ref package names, it
could still use the names for identification (as hash keys, for example),
as long as it hangs onto the package object somewhere appropriate.
Of course, it'll take some care to avoid the MRO system making packages
live longer than they should.

>Additionally, I am not so sure that blessing the package "object" into 
>itself is not an abuse of bless, which while it might work, is just 
>another bit of Perl OO weirdness that would lead to problems down the 

Yeah, I'm not sure about that either.  It's an attempt to run with the
class/instance method duality.  It's kinda neat, but also weird.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About