On Wed, Oct 19, 2005 at 01:30:07PM -0700, Nate Wiger wrote:
: Stevan Little wrote:
: >Nicholas,
: >
: >This is addressed in S11, here is a link:
: >
: >  http://search.cpan.org/~ingy/Perl6-Bible/lib/Perl6/Bible/S11.pod
: >
: >To summarize, the syntax to load the modules is:
: >
: >  use Dog-1.2.1;
: >
: >While the syntax to create a specific version of a module is:
: >
: >  my Dog-1.3.4-cpan:JRANDOM $spot .= new("woof");
: 
: I'd really like to see a more extensible syntax for this. So:
: 
:    use Dog 1.2.1;     # ala Perl5
: 
: And then to extend:
: 
:    use Dog { version => 1.2.1, cpanid => 'JRANDOM' };
: 
: This would allow arbitrary specifications, ie:
: 
:    use Dog { interface => 0.2,
:              version => ['>=', 1.2.1],
:              company => 'Sun Microsystems'
:            };
: 
: >I addresses the class creation syntax partially in the initial  version 
: >of the Metamodel prototype, which was built in p5. I  basically just 
: >aliased the package with the long name (%{"Dog-1.3.4- cpan:JRANDOM::"} = 
: >%{"Dog::"}). However this does no good for loading  of modules.
: 
: Building off the above:
: 
:    %{Dog}{1.2.1}{JRANDOM}
: 
: Or some such, with the longest-matching object winning.

Well, we thought about opening it up like that, but we really kinda
need to establish what is an official part of the "long name" for
uniqueness purposes, and try to avoid too much visual clutter in
standard usage.  That being said, you can certainly add additional
search constraints on a "use" by passing adverbs, but those aren't
counted as part of the official long name.  And we do leave the
meaning of "naming authority" open, so that part is still subject
to extension, and that's one reason we put the naming authority at
the end.  We could even add more hypthenated fields if they were
deemed to be of universal significance.

Larry

Reply via email to