Root-relative namespace keys

kjstol parrotcode at gmail.com
Wed Jan 7 10:51:52 UTC 2009


On Wed, Jan 7, 2009 at 7:57 AM, Allison Randal <allison at parrot.org> wrote:

> 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
>

It's also in the PDD for MDD:
http://www.parrotcode.org/docs/pdd/pdd27_multiple_dispatch.html

which specifies the :invocant flag:

:invocant .param pmc first :invocant


kjs

>
> _______________________________________________
> http://lists.parrot.org/mailman/listinfo/parrot-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.parrot.org/pipermail/parrot-dev/attachments/20090107/645f2839/attachment-0001.htm 


More information about the parrot-dev mailing list