Root-relative namespace keys

Allison Randal allison at parrot.org
Wed Jan 7 06:57:22 UTC 2009


The fundamental problem in this message is better HLL handling in the 
:multi modifier.

 >>     .sub 'xyz' :multi(['MyHash'])

The solution for :multi may be quite different than the solution for the 
opcodes: it's a completely different context, compile-time rather than 
runtime, completely different use (annotating a signature rather than 
performing a lookup), etc. But some fundamental similarities in how we 
refer to classes can and should be preserved.

We already have a consistent system for annotating sub parameters, so I 
have a hard time justifying inventing a new one. Because of this, the 
most compelling idea to me was to make :multi a no-argument modifier to 
.sub, and put the MMD decoration on the .params. We could make that 
consistent with class lookups by using the same key names:

   .sub 'blah' :multi
     .param pmc 'thingy' :hll('lang') :namespace('my') :name('foo')

Which would be the same as:

   .sub 'blah' :multi
     .param pmc 'thingy' :hll('lang') :name(['my';'foo'])

(I really want that 'name' to be 'classname' here, so maybe it should be 
'classname' everywhere.)

Or, we could make it very clear that these are only used by MMD:

   .sub 'blah' :multi
     .param pmc 'thingy' :mmd_hll('lang') :mmd_ns('my') :mmd_name('foo')

We'll also need an annotation for "does this parameter participate in 
MMD?" or maybe for "this parameter doesn't participate in MMD", 
depending on which is more common.

IIRC, we've talked about marking MMD annotations in the .param line on 
the mailing list before, but I can't find the thread at the moment.

Allison



More information about the parrot-dev mailing list