<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">

<channel>
<title><![CDATA[Perl 6: SMOP p6opaque Implementation]]></title>
<link>http://www.perlfoundation.org/perl6/index.cgi?smop_p6opaque_implementation</link>
<description></description>
<pubDate>Thu, 24 Jul 2008 18:28:12 -0000</pubDate>
<webMaster>synedra@gmail.com</webMaster>
<generator>Socialtext Workspace v2.14.7.2</generator>

<item>
<title><![CDATA[SMOP p6opaque Implementation]]></title>
<link>http://www.perlfoundation.org/perl6/index.cgi?smop_p6opaque_implementation</link>
<description><![CDATA[<div class="wiki">
<p>
The p6opaque Responder Interface is the default responder for all Perl 6 objects, according to the <a href="http://www.perlfoundation.org/perl6/index.cgi?smop_oo_api" title="(48 months) In order to ensure the interoperability among object representations and even between different obje...">SMOP OO API</a>.</p>
<h1 id="p6opaque_structure">p6opaque Structure</h1>
<p>
I use 'repr' as class keyword here to indicate that this is not a real class, but the low-level reponder interface that intercepts the calls with the '^!' prefix. Everything else should be delegated to the metaclass instance.</p>
<blockquote>
repr p6opaque {
<blockquote>
has $.^!instanceof is rw; # direct delegation of a single prototype, used by most object instances.<br />
has $.^!WHENCE is rw; # autovivication closure, used by autovivification<br />
has p6opaque_proto $!^!proto_storage handles *;<br />
has Hash of Hash %.^!instance_storage is rw;<br />
default ($ri, $identifier, $capture) {
<blockquote>
$capture.invocant.^!how.dispatch($ri, $identifier, $capture);</blockquote>
}<br />
bool method ^!defined {
<blockquote>
self.^!instance_storage</blockquote>
}</blockquote>
}</blockquote>
<br /><blockquote>
repr p6opaque_proto {
<blockquote>
has $.^!how is rw; # the metaclass instance in use<br />
has $.^!who is rw; # the package implementing this prototype<br />
has @.^!isa is rw; # an array of other protoypes<br />
has @.^!does is rw; # an array of other prototypes<br />
has %.^!storage is rw; # prototype storage (class variables)<br />
has %.^!attributes is rw; # attribute definitions<br />
has %.^!methods is rw; # methods by name<br />
has %.^!submethods is rw; # submethods by name<br />
has %.^!multimethods is rw; # hash of hash of method by name,capture<br />
has %.^!multisubmethods is rw; # hash of hash of submethod by name,capture</blockquote>
}</blockquote>
</div>
]]></description>
<author>Daniel Ruoso</author>
<guid isPermaLink="true">http://www.perlfoundation.org/perl6/index.cgi?smop_p6opaque_implementation</guid>
<pubDate>Thu, 24 Jul 2008 18:28:12 -0000</pubDate>
</item>

</channel>
</rss>