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.

-Nate

Reply via email to