[Israel.pm] Followup on Gaal's talk on Class::Accessor - inside out classes.

Yuval Kogman lists at woobling.org
Sat Feb 28 15:03:20 PST 2004


On Sat, Feb 28, 2004 at 22:52:23 +0200, Yosef Meller wrote:i
 
> There's a technique called inside out objects, in which an attribute,
> rather than being a key in a hash, is a hash in itself keyed by object
> references. Like so:

People who are really upset about their variable privacy usually use
closures that way (yes, inside out objects use closures as methods - the
hash keys are lexicals at the file scope level). But FYI, this can be
also overridden. See http://www.perlmonks.org/index.pl?node_id=315186,
which is pretty scary, I must admit.

And then there's always pseudohashes, right?

Wrong...

Good news everybody, starting from Perl 5.9.0, pseudohashes, the ones
used in the fields.pm pseudo-pragma, have been replaced with
Hash::Util's locking mechanism.

I know this because i recently patched base.pm/fields.pm to play nicer
with them old pseudohashes, when a subclasses of some fielded class does
not introduce anything new.

All you guys who behaved well should have quicker code by 5.10. =)

-- 
 ()  Yuval Kogman <nothingmuch at woobling.org> 0xEBD27418  perl hacker &
 /\  kung foo master: /me beats up some cheese: neeyah!!!!!!!!!!!!!!!!!




More information about the Perl mailing list