Skip to content

Instantly share code, notes, and snippets.

@Tux
Created October 3, 2016 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tux/a165ccf7398834654b213b4855a6ea4c to your computer and use it in GitHub Desktop.
Save Tux/a165ccf7398834654b213b4855a6ea4c to your computer and use it in GitHub Desktop.
$ p6 -MV -e'V.new(<Inline::Perl5>)'
Inline::Perl5 v0.17 /pro/3gl/CPAN/rakudobrew/moar-blead-nom/install/share/perl6/site
$ p6 lib/V.pm Inline::Perl5
Usage:
lib/V.pm
$ p6 -MV -e'V(<Inline::Perl5>)'
Cannot find method 'V' on object of type Str
in block <unit> at -e line 1
Where did I suddenly forget all about the syntax?
--8<--- lib/V.pm
#!perl6
use v6.c;
use Slang::Tuxic;
my $VERSION = "0.001";
class V {
method new (Any $m) {
self.V ($m.Str);
}
method V (Str:D $m) {
my $r = $*REPO.need (CompUnit::DependencySpecification.new (short-name => $m));
say $r.short-name, "\t", $r.version, "\t", $r.distribution.prefix.Str;
}
}
multi sub V (Str:D $m) is export {
V.new ($m);
}
multi sub V (Any @m) is export {
V.new (.Str) for @m;
}
sub MAIN {
V.new (.Str) for @*ARGS;
}
-->8---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment