Root-relative namespace keys
Patrick R. Michaud
pmichaud at pobox.com
Wed Jan 7 16:51:28 UTC 2009
On Tue, Jan 06, 2009 at 10:57:22PM -0800, Allison Randal wrote:
> 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'm in favor of annotating parameters with types rather than the
sub.
I greatly prefer the latter form :name(['my';'foo']), as
opposed separating a class identifier into "parent namespace"
and "name". Let's consistently say that classes are associated
with namespaces and not with entries in a namespace.
> (I really want that 'name' to be 'classname' here, so maybe it should be
> 'classname' everywhere.)
I prefer just :class(['my';'foo']). I'm not too keen on :classname
because we aren't really talking about a name -- we're talking about
the class of the parameter. But I can live with :classname if you
prefer that. Other possibilities: :mmdclass :mmdtype :multi_type
I don't like ":name" because it's really too close to ":named" for
parameters.
> 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.
Naively I think that if a parameter has a :class option, it participates
in MMD, and if it doesn't have such an option, then it doesn't.
Pm
More information about the parrot-dev
mailing list