On Tuesday 09 September 2008 09:51:37 Allison Randal wrote:

> jerry gay wrote:

> > can they be replaced by roles?

> Potentially, yes. In the case of the scalar PMC it would make quite a
> bit of sense as a role (composing in behavior common to scalar data
> types). For the default PMC it makes less sense. But then, I can see
> some argument there that default shouldn't be a PMC at all.

When I revised vtable initialization, I reordered PMC class initialization to 
start at the top of the hierarchy and proceed in inheritance order.  This 
means that PMCs can clone their parent vtables and override only the specific 
function pointers they provide.  Abstract PMCs gave me a little trouble 
because they don't have vtables (they only exist as names).

This isn't really a problem for core PMCs, because they can refer to functions 
defined in other PMCs as they all get compiled together into libparrot.  
That's a real violation of encapsulation for dynpmcs though, and it's the 
reason why we export some 12,000 functions from libparrot.

In the case of MMD, we also need to initialize MMD table entries for roles and 
other abstract PMCs.

We need a way of initializing vtable function pointers given a vtable and the 
name of a PMC, and then we can likely support both features.  (We might even 
use the same mechanism for performing vtable swaps when a Key PMC stops 
holding an INTVAL and starts holding a STRING or a PMC, for example.  Call it 
the ultimate in PIC.)

-- c

Reply via email to