AFAIN this tactic was originally proposed by Damian Conway in his 2000 book 'Object Oriented Perl'... the implementation is typically called 'inside-out objects'.<br><br>These have been implemented in dozens of ways over the last few years, but perhaps the best explanation and description is the documentation that comes with Damian's own Class::Std... here:
<a href="http://search.cpan.org/%7Edconway/Class-Std-v0.0.8/lib/Class/Std.pm">http://search.cpan.org/~dconway/Class-Std-v0.0.8/lib/Class/Std.pm</a><br><br><br>good luck,<br>Montgomery<br><br><br><br><div><span class="gmail_quote">
On 9/14/07, <b class="gmail_sendername">Tim McDaniel</b> <<a href="mailto:tmcd@panix.com">tmcd@panix.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I dimly recall a presentation about "inverted objects" or some phrase<br>like that. The standard Perl procedure boils down to<br> my $obj = {};<br> $obj->{foo} = 123;<br> $obj->{bar} = 456;<br>
<br>The technique was something like<br> my $obj = \0; # some way of generating a unique reference<br> $foo{$obj} = 123;<br> $bar{$obj} = 456;<br>This allows compile-time "member" checking and perhaps other
<br>advantages that I don't recall right now.<br><br>Who thought of this pattern (was it Schwartz?) and where can I read up<br>on it again?<br><br>--<br>Tim McDaniel, <a href="mailto:tmcd@panix.com">tmcd@panix.com</a>
<br>_______________________________________________<br>Austin mailing list<br><a href="mailto:Austin@pm.org">Austin@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/austin">http://mail.pm.org/mailman/listinfo/austin
</a><br></blockquote></div><br>