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

Re: Package:: still ambiguous

Thread Previous | Thread Next
From:
Zefram
Date:
September 14, 2011 09:02
Subject:
Re: Package:: still ambiguous
Message ID:
20110914160219.GU18211@lake.fysh.org
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 
>road.

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.

-zefram

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