Root-relative namespace keys
perlpilot
perlpilot at gmail.com
Wed Jan 7 19:34:39 UTC 2009
On Jan 7, 12:57 am, Allison Randal <alli... 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')
>
How would this affect the use of underscore to mean "any"? For
instance, would the following make sense?
.sub 'blah' :multi
.param pmc 'alpha' :hll('L') :namespace('N') :name(_) # any
class from the hll L and the namespace N?
.param pmc 'beta' :hll('L') :namespace(_) :name('C') # a
class C from any namespace in the hll L?
.param pmc 'gamma' :hll(_) :namespace('N') :name('C') # a class
C from namespace N in any hll?
.param pmc 'delta' :hll('L') :namespace(_) :name(_) # any
class in any namespace from hll L?
extrapolate the others, because hopefully you get the idea by now :-)
Would the above do something useful?
-Scott
--
Jonathan Scott Duff <duff at pobox.com>
More information about the parrot-dev
mailing list