Skip to content
Browse files

switch protos to use | instead of |$

  • Loading branch information...
1 parent b6bfd77 commit 53c78568f70e49a4dfe411237f604ab2cb2ff9de @moritz moritz committed Aug 13, 2012
View
68 src/core/Any.pm
@@ -111,13 +111,13 @@ my class Any {
:excludes_max($excludes_max));
}
- proto method push(|$) { * }
+ proto method push(|) { * }
multi method push(Any:U \$self: *@values) {
&infix:<=>($self, Array.new);
$self.push(@values);
}
- proto method tree(|$) { * }
+ proto method tree(|) { * }
multi method tree(Any:U:) { self }
multi method tree(Any:D:) { self.lol }
multi method tree(Any:D: Cool $count as Int) {
@@ -131,13 +131,13 @@ my class Any {
MapIter.new(self.list, { .&c.item }, Mu).list
}
- proto method unshift(|$) { * }
+ proto method unshift(|) { * }
multi method unshift(Any:U \$self: *@values) {
&infix:<=>($self, Array.new);
$self.unshift(@values);
}
- proto method postcircumfix:<[ ]>(|$) { * }
+ proto method postcircumfix:<[ ]>(|) { * }
multi method postcircumfix:<[ ]>() { self.list }
multi method postcircumfix:<[ ]>(:$BIND!) {
X::Bind::ZenSlice.new(type => self.WHAT).throw
@@ -185,7 +185,7 @@ my class Any {
X::Bind::Slice.new(type => self.WHAT).throw;
}
- proto method at_pos(|$) {*}
+ proto method at_pos(|) {*}
multi method at_pos(Any:D: $pos) {
fail X::OutOfRange.new(
what => 'Index',
@@ -208,7 +208,7 @@ my class Any {
########
# Hash-like methods for Any.
########
- proto method postcircumfix:<{ }>(|$) { * }
+ proto method postcircumfix:<{ }>(|) { * }
multi method postcircumfix:<{ }>() { self }
multi method postcircumfix:<{ }>(:$BIND!) {
X::Bind::ZenSlice.new(type => self.WHAT).throw
@@ -234,7 +234,7 @@ my class Any {
X::Bind::Slice.new(type => self.WHAT).throw
}
- proto method at_key(|$) { * }
+ proto method at_key(|) { * }
multi method at_key(Any:D: $key) {
fail "postcircumfix:<\{ \}> not defined for type {self.WHAT.perl}";
}
@@ -260,96 +260,96 @@ multi infix:<===>($a, $b) {
nqp::p6bool(nqp::iseq_s(nqp::unbox_s($a.WHICH), nqp::unbox_s($b.WHICH)))
}
-proto infix:<before>(|$) { * }
+proto infix:<before>(|) { * }
multi infix:<before>($x?) { Bool::True }
multi infix:<before>(\$a, \$b) { ($a cmp $b) < 0 }
-proto infix:<after>(|$) { * }
+proto infix:<after>(|) { * }
multi infix:<after>($x?) { Bool::True }
multi infix:<after>(\$a, \$b) { ($a cmp $b) > 0 }
# XXX: should really be '$a is rw' (no \) in the next four operators
-proto prefix:<++>(|$) { * }
+proto prefix:<++>(|) { * }
multi prefix:<++>(Mu:D \$a is rw) { $a = $a.succ }
multi prefix:<++>(Mu:U \$a is rw) { $a = 1 }
-proto prefix:<-->(|$) { * }
+proto prefix:<-->(|) { * }
multi prefix:<-->(Mu:D \$a is rw) { $a = $a.pred }
multi prefix:<-->(Mu:U \$a is rw) { $a = -1 }
-proto postfix:<++>(|$) { * }
+proto postfix:<++>(|) { * }
multi postfix:<++>(Mu:D \$a is rw) { my $b = $a; $a = $a.succ; $b }
multi postfix:<++>(Mu:U \$a is rw) { $a = 1; 0 }
-proto postfix:<-->(|$) { * }
+proto postfix:<-->(|) { * }
multi postfix:<-->(Mu:D \$a is rw) { my $b = $a; $a = $a.pred; $b }
multi postfix:<-->(Mu:U \$a is rw) { $a = -1; 0 }
-proto infix:<min>(|$) { * }
+proto infix:<min>(|) { * }
multi infix:<min>(*@args) { @args.min }
# XXX the multi version suffers from a multi dispatch bug
# where the mandatory named is ignored in the presence of a slurpy
-#proto sub min(|$) { * }
+#proto sub min(|) { * }
#multi sub min(*@args) { @args.min() }
#multi sub min(*@args, :&by!) { @args.min(&by) }
sub min(*@args, :&by = &infix:<cmp>) { @args.min(&by) }
-proto infix:<max>(|$) { * }
+proto infix:<max>(|) { * }
multi infix:<max>(*@args) { @args.max }
-#proto sub max(|$) { * }
+#proto sub max(|) { * }
#multi sub max(*@args) { @args.max() }
#multi sub max(*@args, :&by!) { @args.max(&by) }
sub max(*@args, :&by = &infix:<cmp>) { @args.max(&by) }
-proto infix:<minmax>(|$) { * }
+proto infix:<minmax>(|) { * }
multi infix:<minmax>(*@args) { @args.minmax }
-#proto sub minmax(|$) { * }
+#proto sub minmax(|) { * }
#multi sub minmax(*@args) { @args.minmax() }
#multi sub minmax(*@args, :&by!) { @args.minmax(&by) }
sub minmax(*@args, :&by = &infix:<cmp>) { @args.minmax(&by) }
-proto map(|$) {*}
+proto map(|) {*}
multi map(&code, *@values) { @values.map(&code) }
-proto grep(|$) {*}
+proto grep(|) {*}
multi grep(Mu $test, *@values) { @values.grep($test) }
-proto first(|$) {*}
+proto first(|) {*}
multi first(Mu $test, *@values) { @values.first($test) }
-proto join(|$) { * }
+proto join(|) { * }
multi join($sep = '', *@values) { @values.join($sep) }
-proto pick(|$) { * }
+proto pick(|) { * }
multi pick($n, *@values) { @values.pick($n) }
-proto roll(|$) { * }
+proto roll(|) { * }
multi roll($n, *@values) { @values.roll($n) }
-proto keys(|$) { * }
+proto keys(|) { * }
multi keys($x) { $x.keys }
-proto values(|$) { * }
+proto values(|) { * }
multi values($x) { $x.values }
-proto pairs(|$) { * }
+proto pairs(|) { * }
multi pairs($x) { $x.pairs }
-proto kv(|$) { * }
+proto kv(|) { * }
multi kv($x) { $x.kv }
-proto elems(|$) { * }
+proto elems(|) { * }
multi elems($a) { $a.elems }
-proto end(|$) { * }
+proto end(|) { * }
multi end($a) { $a.end }
-proto classify(|$) { * }
+proto classify(|) { * }
multi classify(&test, *@items) { @items.classify(&test) }
-proto uniq(|$) { * }
+proto uniq(|) { * }
multi uniq(*@values) { @values.uniq }
-proto sub sort(|$) {*}
+proto sub sort(|) {*}
multi sub sort(*@values) {
@values.at_pos(0).^does(Callable)
?? do { my $cmp := @values.shift; @values.sort($cmp) }
View
6 src/core/Array.pm
@@ -1,7 +1,7 @@
class Array {
# Has attributes and parent List declared in BOOTSTRAP.
- method new(|$) {
+ method new(|) {
my Mu $args := pir::perl6_current_args_rpa__P();
nqp::shift($args);
nqp::p6list($args, self.WHAT, Bool::True);
@@ -29,7 +29,7 @@ class Array {
-> { nqp::bindpos($items, $pos, $v) } )
}
- proto method bind_pos(|$) { * }
+ proto method bind_pos(|) { * }
multi method bind_pos($pos is copy, \$bindval) is rw {
$pos = $pos.Int;
self.gimme($pos + 1);
@@ -83,7 +83,7 @@ class Array {
nqp::findmethod(List, 'STORE_AT_POS')(self, $pos, $v);
}
- method STORE(|$) {
+ method STORE(|) {
# get arguments, shift off invocant
my $args := pir::perl6_current_args_rpa__P();
nqp::shift($args);
View
2 src/core/Backtrace.pm
@@ -25,7 +25,7 @@ my class Backtrace::Frame {
}
my class Backtrace is List {
- proto method new(|$) {*}
+ proto method new(|) {*}
multi method new(Exception $e, Int $offset = 0) {
self.new(nqp::getattr(nqp::p6decont($e), Exception, '$!ex').backtrace, $offset);
View
22 src/core/Bool.pm
@@ -48,29 +48,29 @@ multi prefix:<not>(Mu \$a) { nqp::p6bool($a.Bool ?? 0 !! 1) }
proto prefix:<?^>(Mu $) { * }
multi prefix:<?^>(Mu \$a) { not $a }
-proto infix:<?&>(|$) { * }
+proto infix:<?&>(|) { * }
multi infix:<?&>(Mu $x = Bool::True) { $x.Bool }
multi infix:<?&>(Mu \$a, Mu \$b) { $a.Bool && $b.Bool }
-proto infix:<?|>(|$) { * }
+proto infix:<?|>(|) { * }
multi infix:<?|>(Mu $x = Bool::False) { $x.Bool }
multi infix:<?|>(Mu \$a, Mu \$b) { $a.Bool || $b.Bool }
-proto infix:<?^>(|$) { * }
+proto infix:<?^>(|) { * }
multi infix:<?^>(Mu $x = Bool::False) { $x.Bool }
multi infix:<?^>(Mu \$a, Mu \$b) { $a.Bool ^^ $b.Bool }
# These operators are normally handled as macros in the compiler;
# we define them here for use as arguments to functions.
-proto infix:<&&>(|$) { * }
+proto infix:<&&>(|) { * }
multi infix:<&&>(Mu $x = Bool::True) { $x }
multi infix:<&&>(Mu \$a, Mu \$b) { $a && $b }
-proto infix:<||>(|$) { * }
+proto infix:<||>(|) { * }
multi infix:<||>(Mu $x = Bool::False) { $x }
multi infix:<||>(Mu \$a, Mu \$b) { $a || $b }
-proto infix:<^^>(|$) { * }
+proto infix:<^^>(|) { * }
multi infix:<^^>(Mu $x = Bool::False) { $x }
multi infix:<^^>(Mu \$a, Mu \$b) { $a ^^ $b }
multi infix:<^^>(*@a) {
@@ -84,23 +84,23 @@ multi infix:<^^>(*@a) {
$a;
}
-proto infix:<//>(|$) { * }
+proto infix:<//>(|) { * }
multi infix:<//>(Mu $x = Any) { $x }
multi infix:<//>(Mu \$a, Mu \$b) { $a // $b }
-proto infix:<and>(|$) { * }
+proto infix:<and>(|) { * }
multi infix:<and>(Mu $x = Bool::True) { $x }
multi infix:<and>(Mu \$a, Mu \$b) { $a && $b }
-proto infix:<or>(|$) { * }
+proto infix:<or>(|) { * }
multi infix:<or>(Mu $x = Bool::False) { $x }
multi infix:<or>(Mu \$a, Mu \$b) { $a || $b }
-proto infix:<xor>(|$) { * }
+proto infix:<xor>(|) { * }
multi infix:<xor>(Mu $x = Bool::False) { $x }
multi infix:<xor>(Mu \$a, Mu \$b) { $a ^^ $b }
multi infix:<xor>(*@a) { &infix:<^^>(@a); }
-proto infix:<orelse>(|$) { * }
+proto infix:<orelse>(|) { * }
multi infix:<orelse>(Mu $x = Any) { $x }
multi infix:<orelse>(Mu \$a, Mu \$b) { $a // $b }
View
4 src/core/Complex.pm
@@ -2,7 +2,7 @@ my class Complex is Cool does Numeric {
has num $.re;
has num $.im;
- proto method new(|$) { * }
+ proto method new(|) { * }
multi method new(Real \$re, Real \$im) {
my $new = nqp::create(self);
$new.BUILD($re.Num, $im.Num);
@@ -396,7 +396,7 @@ multi sub infix:<==>(Complex:D \$a, Complex:D \$b) returns Bool:D { $a.re == $b.
multi sub infix:<==>(Complex:D \$a, Real \$b) returns Bool:D { $a.re == $b && $a.im == 0e0 }
multi sub infix:<==>(Real \$a, Complex:D \$b) returns Bool:D { $a == $b.re && 0e0 == $b.im }
-proto postfix:<i>(|$) returns Complex:D { * }
+proto postfix:<i>(|) returns Complex:D { * }
multi postfix:<i>(Real \$a) returns Complex:D { Complex.new(0e0, $a); }
multi postfix:<i>(Complex:D \$a) returns Complex:D { Complex.new(-$a.im, $a.re) }
multi postfix:<i>(Numeric \$a) returns Complex:D { $a * Complex.new(0e0, 1e0) }
View
26 src/core/Cool.pm
@@ -36,11 +36,11 @@ my class Cool {
method acotanh() { self.Numeric.acotanh }
method cis() { self.Numeric.cis }
- proto method log(|$) {*}
+ proto method log(|) {*}
multi method log(Cool:D: ) { self.Numeric.log }
multi method log(Cool:D: $base) { self.Numeric.log($base.Numeric) }
- proto method exp(|$) {*}
+ proto method exp(|) {*}
multi method exp(Cool:D: ) { self.Numeric.exp }
multi method exp(Cool:D: $base) { self.Numeric.exp($base.Numeric) }
@@ -112,7 +112,7 @@ my class Cool {
}
method trans(*@a) { self.Str.trans(@a) }
- proto method index(|$) {*}
+ proto method index(|) {*}
multi method index(Cool $needle, Cool $pos = 0) {
if $needle eq '' {
my $chars = self.chars;
@@ -127,7 +127,7 @@ my class Cool {
$result < 0 ?? Int !! $result;
}
- proto method rindex(|$) {*}
+ proto method rindex(|) {*}
multi method rindex(Cool $needle, Cool $pos?) {
if $needle eq '' {
return $pos.defined && $pos < self.chars
@@ -151,23 +151,23 @@ my class Cool {
}
method ords(Cool:D:) { self.Str.ords }
- proto method split(|$) {*}
+ proto method split(|) {*}
multi method split(Regex $pat, $limit = $Inf, :$all) {
self.Stringy.split($pat, $limit, :$all);
}
multi method split(Cool $pat, $limit = $Inf, :$all) {
self.Stringy.split($pat.Stringy, $limit, :$all);
}
- proto method match(|$) {*}
+ proto method match(|) {*}
multi method match(Cool:D: $target, *%adverbs) {
self.Stringy.match($target, |%adverbs)
}
- proto method comb(|$) {*}
+ proto method comb(|) {*}
multi method comb() { self.Str.comb() }
multi method comb(Regex $matcher, $limit = $Inf) { self.Str.comb($matcher, $limit) }
- proto method subst(|$) {*}
+ proto method subst(|) {*}
multi method subst($matcher, $replacement, *%adverbs) {
self.Stringy.subst($matcher, $replacement, |%adverbs);
}
@@ -203,21 +203,21 @@ sub uc(Cool $s) { $s.uc }
sub ucfirst(Cool $s) is DEPRECATED { $s.ucfirst }
-proto sub rindex(|$) { * };
+proto sub rindex(|) { * };
multi sub rindex(Cool $s, Cool $needle, Cool $pos) { $s.rindex($needle, $pos) };
multi sub rindex(Cool $s, Cool $needle) { $s.rindex($needle) };
-proto sub ords(|$) { * }
+proto sub ords(|) { * }
multi sub ords(Cool $s) { ords($s.Stringy) }
-proto sub comb(|$) { * }
+proto sub comb(|) { * }
multi sub comb(Regex $matcher, Cool $input, $limit = *) { $input.comb($matcher, $limit) }
-proto sub capitalize(|$) { * }
+proto sub capitalize(|) { * }
multi sub capitalize(Str:D $x) {$x.capitalize }
multi sub capitalize(Cool $x) {$x.Stringy.capitalize }
-proto sub tclc(|$) { * }
+proto sub tclc(|) { * }
multi sub tclc(Cool $x) { tclc $x.Str }
sub sprintf(Cool $format, *@args) {
View
2 src/core/EnumMap.pm
@@ -25,7 +25,7 @@ my class EnumMap does Associative {
so self.keys.any.match($topic);
}
- proto method exists(|$) {*}
+ proto method exists(|) {*}
multi method exists(EnumMap:D: Str:D \$key) {
nqp::p6bool(
nqp::defined($!storage)
View
12 src/core/Exception.pm
@@ -85,7 +85,7 @@ my class X::Method::InvalidQualifier is Exception {
}
-sub EXCEPTION(|$) {
+sub EXCEPTION(|) {
my Mu $parrot_ex := nqp::shift(pir::perl6_current_args_rpa__P());
my Mu $payload := nqp::atkey($parrot_ex, 'payload');
if nqp::p6bool(nqp::istype($payload, Exception)) {
@@ -113,7 +113,7 @@ sub EXCEPTION(|$) {
}
my class X::Comp::AdHoc { ... }
-sub COMP_EXCEPTION(|$) {
+sub COMP_EXCEPTION(|) {
my Mu $parrot_ex := nqp::shift(pir::perl6_current_args_rpa__P());
my Mu $payload := nqp::atkey($parrot_ex, 'payload');
if nqp::p6bool(nqp::istype($payload, Exception)) {
@@ -148,7 +148,7 @@ do {
}
- sub print_exception(|$) is hidden_from_backtrace {
+ sub print_exception(|) is hidden_from_backtrace {
my Mu $ex := nqp::atpos(pir::perl6_current_args_rpa__P(), 0);
try {
my $e := EXCEPTION($ex);
@@ -170,7 +170,7 @@ do {
}
}
- sub print_control(|$) is hidden_from_backtrace {
+ sub print_control(|) is hidden_from_backtrace {
my Mu $ex := nqp::atpos(pir::perl6_current_args_rpa__P(), 0);
my int $type = nqp::atkey_i($ex, 'type');
if ($type == pir::const::CONTROL_OK) {
@@ -210,15 +210,15 @@ do {
my Mu $comp := pir::compreg__Ps('perl6');
$comp.HOW.add_method($comp, 'handle-exception',
- method (|$) {
+ method (|) {
my Mu $ex := nqp::atpos(pir::perl6_current_args_rpa__P(), 1);
pir::perl6_invoke_catchhandler__vPP(&print_exception, $ex);
nqp::exit(1);
0;
}
);
$comp.HOW.add_method($comp, 'handle-control',
- method (|$) {
+ method (|) {
my Mu $ex := nqp::atpos(pir::perl6_current_args_rpa__P(), 1);
pir::perl6_invoke_catchhandler__vPP(&print_control, $ex);
nqp::rethrow($ex);
View
2 src/core/Hash.pm
@@ -52,7 +52,7 @@ my class Hash {
self
}
- proto method delete(|$) { * }
+ proto method delete(|) { * }
multi method delete($key as Str) {
my Mu $val = self.at_key($key);
nqp::deletekey(
View
32 src/core/IO.pm
@@ -1,25 +1,25 @@
my class X::IO::Copy { ... }
my class X::IO::Dir { ... }
-sub print(|$) {
+sub print(|) {
my $args := pir::perl6_current_args_rpa__P();
$*OUT.print(nqp::shift($args)) while $args;
Bool::True
}
-sub say(|$) {
+sub say(|) {
my $args := pir::perl6_current_args_rpa__P();
$*OUT.print(nqp::shift($args).gist) while $args;
$*OUT.print("\n");
}
-sub note(|$) {
+sub note(|) {
my $args := pir::perl6_current_args_rpa__P();
$*ERR.print(nqp::shift($args).gist) while $args;
$*ERR.print("\n");
}
-sub gist(|$) {
+sub gist(|) {
nqp::p6parcel(pir::perl6_current_args_rpa__P(), Mu).gist
}
@@ -87,7 +87,7 @@ class IO does IO::FileTestable {
has $.chomp = Bool::True;
has $.path;
- proto method open(|$) { * }
+ proto method open(|) { * }
multi method open($path? is copy, :$r, :$w, :$a, :$p, :$bin, :$chomp = Bool::True,
:enc(:$encoding) = 'utf8') {
$path //= $.path;
@@ -187,7 +187,7 @@ class IO does IO::FileTestable {
}
- proto method print(|$) { * }
+ proto method print(|) { * }
multi method print(IO:D: Str:D $value) {
$!PIO.print(nqp::unbox_s($value));
Bool::True
@@ -333,32 +333,32 @@ sub rmdir($path) {
}
}
-proto sub open(|$) { * }
+proto sub open(|) { * }
multi sub open($path, :$r, :$w, :$a, :$p, :$bin, :$chomp = Bool::True, :enc(:$encoding) = 'utf8') {
IO.new.open($path, :$r, :$w, :$a, :$p, :$bin, :$chomp, :$encoding);
}
-proto sub lines(|$) { * }
+proto sub lines(|) { * }
multi sub lines($fh = $*ARGFILES, $limit = $Inf) {
$fh.lines($limit)
}
-proto sub get(|$) { * }
+proto sub get(|) { * }
multi sub get($fh = $*ARGFILES) {
$fh.get()
}
-proto sub getc(|$) { * }
+proto sub getc(|) { * }
multi sub getc($fh = $*ARGFILES) {
$fh.getc()
}
-proto sub close(|$) { * }
+proto sub close(|) { * }
multi sub close($fh) {
$fh.close()
}
-proto sub slurp(|$) { * }
+proto sub slurp(|) { * }
multi sub slurp($filename, :$bin = False) {
my $handle = open($filename, :r, :$bin);
if $bin {
@@ -382,7 +382,7 @@ multi sub slurp(IO $io = $*ARGFILES) {
$io.slurp;
}
-proto sub spurt(|$) { * }
+proto sub spurt(|) { * }
multi sub spurt(Cool $filename,
Cool $contents,
:encoding(:$enc) = 'utf8',
@@ -408,7 +408,7 @@ multi sub spurt(Cool $filename,
}
my class X::IO::Cwd { ... }
-proto sub cwd(|$) { * }
+proto sub cwd(|) { * }
multi sub cwd() {
return pir::new__Ps('OS').cwd();
@@ -423,7 +423,7 @@ multi sub cwd() {
my class X::IO::Chdir { ... }
-proto sub chdir(|$) { * }
+proto sub chdir(|) { * }
multi sub chdir($path as Str) {
pir::new__PS('OS').chdir(nqp::unbox_s($path));
$*CWD = nqp::p6box_s(pir::new__PS('OS').cwd);
@@ -439,7 +439,7 @@ multi sub chdir($path as Str) {
}
my class X::IO::Mkdir { ... }
-proto sub mkdir(|$) { * }
+proto sub mkdir(|) { * }
multi sub mkdir($path as Str, $mode = 0o777) {
pir::new__PS('OS').mkdir($path, $mode);
return True;
View
20 src/core/List.pm
@@ -5,7 +5,7 @@ my class List does Positional {
# has $!flattens; # true if this list flattens its parcels
# has $!nextiter; # iterator for generating remaining elements
- method new(|$) {
+ method new(|) {
my Mu $args := pir::perl6_current_args_rpa__P();
nqp::shift($args);
nqp::p6list($args, self.WHAT, Mu);
@@ -36,7 +36,7 @@ my class List does Positional {
method flattens() { $!flattens }
my &itemify = { .elems == 1 ?? $_ !! [.list] };
- proto method tree(|$) {*}
+ proto method tree(|) {*}
multi method tree(List:U:) { self }
multi method tree(List:D:) {
MapIter.new(self, &itemify, Mu).list;
@@ -367,36 +367,36 @@ my class List does Positional {
}
}
-sub eager(|$) {
+sub eager(|) {
nqp::p6parcel(pir::perl6_current_args_rpa__P(), Any).eager
}
-sub flat(|$) {
+sub flat(|) {
nqp::p6list(pir::perl6_current_args_rpa__P(), List, Bool::True)
}
-sub list(|$) {
+sub list(|) {
nqp::p6list(pir::perl6_current_args_rpa__P(), List, Mu)
}
-proto infix:<xx>(|$) { * }
+proto infix:<xx>(|) { * }
multi infix:<xx>() { fail "No zero-arg meaning for infix:<xx>" }
multi infix:<xx>(Mu \$x) { $x }
multi infix:<xx>(Mu \$x, $n is copy, :$thunked) {
$n = nqp::p6bool(nqp::istype($n, Whatever)) ?? $Inf !! $n.Int;
GatherIter.new({ take ($thunked ?? $x() !! $x) while $n-- > 0; }, :infinite($n == $Inf)).list
}
-proto sub pop(|$) {*}
+proto sub pop(|) {*}
multi sub pop(@a) { @a.pop }
-proto sub shift(|$) {*}
+proto sub shift(|) {*}
multi sub shift(@a) { @a.shift }
-proto sub unshift(|$) {*}
+proto sub unshift(|) {*}
multi sub unshift(\$a, *@elems) { $a.unshift: @elems }
-proto sub push(|$) {*}
+proto sub push(|) {*}
multi sub push(\$a, *@elems) { $a.push: @elems }
sub reverse(*@a) { @a.reverse }
View
2 src/core/LoL.pm
@@ -2,7 +2,7 @@ class LoL {
# declared in BOOTSTRAP:
# is List; # parent class
- method new(|$) {
+ method new(|) {
my Mu $args := pir::perl6_current_args_rpa__P();
nqp::shift($args);
nqp::p6list($args, self.WHAT, Mu);
View
30 src/core/Mu.pm
@@ -3,7 +3,7 @@ my class X::Method::NotFound { ... }
my class X::Method::InvalidQualifier { ... }
my class Mu {
- proto method ACCEPTS(|$) { * }
+ proto method ACCEPTS(|) { * }
multi method ACCEPTS(Mu:U: Mu \$topic) {
nqp::p6bool(nqp::istype($topic, self))
}
@@ -12,7 +12,7 @@ my class Mu {
nqp::p6box_i(nqp::where(self))
}
- proto method WHICH(|$) {*}
+ proto method WHICH(|) {*}
multi method WHICH(Mu:U:) {
nqp::box_s(nqp::unbox_s(self.^name), ObjAt);
}
@@ -34,7 +34,7 @@ my class Mu {
self.HOW.docs // Any
}
- proto method Bool(|$) {*}
+ proto method Bool(|) {*}
multi method Bool() {
self.defined
}
@@ -46,7 +46,7 @@ my class Mu {
nqp::p6bool(nqp::isconcrete(self))
}
- proto method new(|$) { * }
+ proto method new(|) { * }
multi method new(*%attrinit) {
self.bless(*, |%attrinit);
}
@@ -139,15 +139,15 @@ my class Mu {
self
}
- proto method Numeric(|$) { * }
+ proto method Numeric(|) { * }
multi method Numeric(Mu:U \$v:) {
warn (nqp::iscont($v)
?? "use of uninitialized variable { $v.VAR.name }"
!! "use of uninitialized value")
~ " of type {self.^name} in numeric context";
0
}
- proto method Real(|$) { * }
+ proto method Real(|) { * }
multi method Real(Mu:U \$v:) {
warn (nqp::iscont($v)
?? "use of uninitialized variable { $v.VAR.name }"
@@ -156,7 +156,7 @@ my class Mu {
0
}
- proto method Str(|$) { * }
+ proto method Str(|) { * }
multi method Str(Mu:U \$v:) {
warn (nqp::iscont($v)
?? "use of uninitialized variable { $v.VAR.name }"
@@ -172,15 +172,15 @@ my class Mu {
method item(Mu \$item:) is rw { $item }
- proto method say(|$) { * }
+ proto method say(|) { * }
multi method say() { say(self) }
method print() { print(self) }
- proto method gist(|$) { * }
+ proto method gist(|) { * }
multi method gist(Mu:U:) { self.HOW.name(self) ~ '()' }
multi method gist(Mu:D:) { self.perl }
- proto method perl(|$) { * }
+ proto method perl(|) { * }
multi method perl(Mu:U:) { self.HOW.name(self) }
multi method perl(Mu:D:) {
my @attrs;
@@ -193,12 +193,12 @@ my class Mu {
self.^name() ~ '.new(' ~ @attrs.join(', ') ~ ')';
}
- proto method DUMP(|$) { * }
+ proto method DUMP(|) { * }
multi method DUMP(Mu:D:) { self.perl }
multi method DUMP(Mu:U:) { self.perl }
method DUMP-ID() { self.HOW.name(self) ~ '<' ~ self.WHERE ~ '>' }
- proto method isa(|$) { * }
+ proto method isa(|) { * }
multi method isa(Mu \$self: Mu $type) {
nqp::p6bool($self.HOW.isa($self, $type.WHAT))
}
@@ -399,10 +399,10 @@ my class Mu {
}
-proto sub defined(|$) { * }
+proto sub defined(|) { * }
multi sub defined(Mu \$x) { $x.defined }
-proto sub infix:<~~>(|$) { * }
+proto sub infix:<~~>(|) { * }
multi sub infix:<~~>(Mu \$topic, Mu \$matcher) {
$matcher.ACCEPTS($topic).Bool;
}
@@ -431,7 +431,7 @@ multi sub infix:<eqv>(@a, @b) {
Bool::True
}
-sub DUMP(|$) {
+sub DUMP(|) {
my Mu $args := pir::perl6_current_args_rpa__P();
my Mu $topic := nqp::shift($args);
if nqp::isnull($topic) { '(null)' }
View
44 src/core/Num.pm
@@ -86,15 +86,15 @@ my class Num does Real {
nqp::p6box_n(nqp::exp_n(nqp::unbox_n(self)));
}
- proto method log(|$) {*}
+ proto method log(|) {*}
multi method log(Num:D: ) {
nqp::p6box_n(nqp::log_n(nqp::unbox_n(self)));
}
multi method log(Num:D: Num \$base) {
self.log() / $base.log();
}
- proto method sqrt(|$) {*}
+ proto method sqrt(|) {*}
multi method sqrt(Num:D: ) {
nqp::p6box_n(nqp::sqrt_n(nqp::unbox_n(self)));
}
@@ -114,35 +114,35 @@ my class Num does Real {
!! nqp::fromnum_I(nqp::floor_n(nqp::unbox_n(self)), Int);
}
- proto method sin(|$) {*}
+ proto method sin(|) {*}
multi method sin(Num:D: ) {
nqp::p6box_n(nqp::sin_n(nqp::unbox_n(self)));
}
- proto method asin(|$) {*}
+ proto method asin(|) {*}
multi method asin(Num:D: ) {
nqp::p6box_n(nqp::asin_n(nqp::unbox_n(self)));
}
- proto method cos(|$) {*}
+ proto method cos(|) {*}
multi method cos(Num:D: ) {
nqp::p6box_n(nqp::cos_n(nqp::unbox_n(self)));
}
- proto method acos(|$) {*}
+ proto method acos(|) {*}
multi method acos(Num:D: ) {
nqp::p6box_n(nqp::acos_n(nqp::unbox_n(self)));
}
- proto method tan(|$) {*}
+ proto method tan(|) {*}
multi method tan(Num:D: ) {
nqp::p6box_n(nqp::tan_n(nqp::unbox_n(self)));
}
- proto method atan(|$) {*}
+ proto method atan(|) {*}
multi method atan(Num:D: ) {
nqp::p6box_n(nqp::atan_n(nqp::unbox_n(self)));
}
- proto method sec(|$) {*}
+ proto method sec(|) {*}
multi method sec(Num:D: ) {
nqp::p6box_n(nqp::sec_n(nqp::unbox_n(self)));
}
- proto method asec(|$) {*}
+ proto method asec(|) {*}
multi method asec(Num:D: ) {
nqp::p6box_n(nqp::asec_n(nqp::unbox_n(self)));
}
@@ -158,51 +158,51 @@ my class Num does Real {
method acotan(Num:D:) {
nqp::p6box_n(nqp::atan_n(nqp::div_n(1, nqp::unbox_n(self))));
}
- proto method sinh(|$) {*}
+ proto method sinh(|) {*}
multi method sinh(Num:D: ) {
nqp::p6box_n(nqp::sinh_n(nqp::unbox_n(self)));
}
- proto method asinh(|$) {*}
+ proto method asinh(|) {*}
multi method asinh(Num:D: ) {
(self + (self * self + 1).sqrt).log;
}
- proto method cosh(|$) {*}
+ proto method cosh(|) {*}
multi method cosh(Num:D: ) {
nqp::p6box_n(nqp::cosh_n(nqp::unbox_n(self)));
}
- proto method acosh(|$) {*}
+ proto method acosh(|) {*}
multi method acosh(Num:D: ) {
(self + (self * self - 1).sqrt).log;
}
- proto method tanh(|$) {*}
+ proto method tanh(|) {*}
multi method tanh(Num:D: ) {
nqp::p6box_n(nqp::tanh_n(nqp::unbox_n(self)));
}
- proto method atanh(|$) {*}
+ proto method atanh(|) {*}
multi method atanh(Num:D: ) {
((1 + self) / (1 - self)).log / 2;
}
- proto method sech(|$) {*}
+ proto method sech(|) {*}
multi method sech(Num:D: ) {
nqp::p6box_n(nqp::sech_n(nqp::unbox_n(self)));
}
- proto method asech(|$) {*}
+ proto method asech(|) {*}
multi method asech(Num:D: ) {
(1 / self).acosh;
}
- proto method cosech(|$) {*}
+ proto method cosech(|) {*}
multi method cosech(Num:D: ) {
nqp::p6box_n(nqp::div_n(1, nqp::sinh_n(nqp::unbox_n(self))));
}
- proto method acosech(|$) {*}
+ proto method acosech(|) {*}
multi method acosech(Num:D: ) {
(1 / self).asinh;
}
- proto method cotanh(|$) {*}
+ proto method cotanh(|) {*}
multi method cotanh(Num:D: ) {
nqp::p6box_n(nqp::div_n(1, nqp::tanh_n(nqp::unbox_n(self))));
}
- proto method acotanh(|$) {*}
+ proto method acotanh(|) {*}
multi method acotanh(Num:D: ) {
(1 / self).atanh;
}
View
88 src/core/Numeric.pm
@@ -5,13 +5,13 @@ my role Numeric {
self.isNaN ?? $a.isNaN !! $a == self;
}
- proto method log(|$) {*}
+ proto method log(|) {*}
multi method log(Numeric:D: Cool $base) { self.log / $base.Numeric.log }
multi method log(Numeric:D: Numeric $base) { self.log / $base.log }
method log10() { self.log / 10e0.log }
- proto method exp(|$) {*}
+ proto method exp(|) {*}
multi method exp(Numeric:D: $base) {
$base ** self;
}
@@ -31,146 +31,146 @@ multi sub infix:<eqv>(Numeric $a, Numeric $b) {
## arithmetic operators
-proto prefix:<+>(|$) { * }
+proto prefix:<+>(|) { * }
multi prefix:<+>(\$a) { $a.Numeric }
-proto prefix:<->(|$) { * }
+proto prefix:<->(|) { * }
multi prefix:<->(\$a) { -$a.Numeric }
-proto sub abs(|$) { * }
+proto sub abs(|) { * }
multi sub abs(\$a) { abs $a.Numeric }
-proto sub sign(|$) {*}
+proto sub sign(|) {*}
multi sub sign(Numeric \$x) { $x.sign }
multi sub sign(Cool \$x) { $x.Numeric.sign }
-proto sub log(|$) {*}
+proto sub log(|) {*}
multi sub log(Numeric $x) { $x.log }
multi sub log(Numeric $x, Numeric $base) { $x.log($base) }
multi sub log(Cool $x) { $x.Numeric.log }
multi sub log(Cool $x, Cool $base) { $x.Numeric.log($base.Numeric) }
-proto sub log10(|$) {*}
+proto sub log10(|) {*}
multi sub log10(Numeric $x) { $x.log(10e0) }
multi sub log10(Cool $x) { $x.Numeric.log(10e0) }
-proto sub exp(|$) {*}
+proto sub exp(|) {*}
multi sub exp(Numeric $x) { $x.exp }
multi sub exp(Numeric $x, Numeric $base) { $x.exp($base) }
-proto sub sin(|$) {*}
+proto sub sin(|) {*}
multi sub sin(Numeric \$x) { $x.sin }
multi sub sin(Cool \$x) { $x.Numeric.sin }
-proto sub asin(|$) {*}
+proto sub asin(|) {*}
multi sub asin(Numeric \$x) { $x.asin }
multi sub asin(Cool \$x) { $x.Numeric.asin }
-proto sub cos(|$) {*}
+proto sub cos(|) {*}
multi sub cos(Numeric \$x) { $x.cos }
multi sub cos(Cool \$x) { $x.Numeric.cos }
-proto sub acos(|$) {*}
+proto sub acos(|) {*}
multi sub acos(Numeric \$x) { $x.acos }
multi sub acos(Cool \$x) { $x.Numeric.acos }
-proto sub tan(|$) {*}
+proto sub tan(|) {*}
multi sub tan(Numeric \$x) { $x.tan }
multi sub tan(Cool \$x) { $x.Numeric.tan }
-proto sub atan(|$) {*}
+proto sub atan(|) {*}
multi sub atan(Numeric \$x) { $x.atan }
multi sub atan(Cool \$x) { $x.Numeric.atan }
-proto sub sec(|$) {*}
+proto sub sec(|) {*}
multi sub sec(Numeric \$x) { $x.sec }
multi sub sec(Cool \$x) { $x.Numeric.sec }
-proto sub asec(|$) {*}
+proto sub asec(|) {*}
multi sub asec(Numeric \$x) { $x.asec }
multi sub asec(Cool \$x) { $x.Numeric.asec }
-proto sub cosec(|$) {*}
+proto sub cosec(|) {*}
multi sub cosec(Numeric \$x) { $x.cosec }
multi sub cosec(Cool \$x) { $x.Numeric.cosec }
-proto sub acosec(|$) {*}
+proto sub acosec(|) {*}
multi sub acosec(Numeric \$x) { $x.acosec }
multi sub acosec(Cool \$x) { $x.Numeric.acosec }
-proto sub cotan(|$) {*}
+proto sub cotan(|) {*}
multi sub cotan(Numeric \$x) { $x.cotan }
multi sub cotan(Cool \$x) { $x.Numeric.cotan }
-proto sub acotan(|$) {*}
+proto sub acotan(|) {*}
multi sub acotan(Numeric \$x) { $x.acotan }
multi sub acotan(Cool \$x) { $x.Numeric.acotan }
-proto sub sinh(|$) {*}
+proto sub sinh(|) {*}
multi sub sinh(Numeric \$x) { $x.sinh }
multi sub sinh(Cool \$x) { $x.Numeric.sinh }
-proto sub asinh(|$) {*}
+proto sub asinh(|) {*}
multi sub asinh(Numeric \$x) { $x.asinh }
multi sub asinh(Cool \$x) { $x.Numeric.asinh }
-proto sub cosh(|$) {*}
+proto sub cosh(|) {*}
multi sub cosh(Numeric \$x) { $x.cosh }
multi sub cosh(Cool \$x) { $x.Numeric.cosh }
-proto sub acosh(|$) {*}
+proto sub acosh(|) {*}
multi sub acosh(Numeric \$x) { $x.acosh }
multi sub acosh(Cool \$x) { $x.Numeric.acosh }
-proto sub tanh(|$) {*}
+proto sub tanh(|) {*}
multi sub tanh(Numeric \$x) { $x.tanh }
multi sub tanh(Cool \$x) { $x.Numeric.tanh }
-proto sub atanh(|$) {*}
+proto sub atanh(|) {*}
multi sub atanh(Numeric \$x) { $x.atanh }
multi sub atanh(Cool \$x) { $x.Numeric.atanh }
-proto sub sech(|$) {*}
+proto sub sech(|) {*}
multi sub sech(Numeric \$x) { $x.sech }
multi sub sech(Cool \$x) { $x.Numeric.sech }
-proto sub asech(|$) {*}
+proto sub asech(|) {*}
multi sub asech(Numeric \$x) { $x.asech }
multi sub asech(Cool \$x) { $x.Numeric.asech }
-proto sub cosech(|$) {*}
+proto sub cosech(|) {*}
multi sub cosech(Numeric \$x) { $x.cosech }
multi sub cosech(Cool \$x) { $x.Numeric.cosech }
-proto sub acosech(|$) {*}
+proto sub acosech(|) {*}
multi sub acosech(Numeric \$x) { $x.acosech }
multi sub acosech(Cool \$x) { $x.Numeric.acosech }
-proto sub cotanh(|$) {*}
+proto sub cotanh(|) {*}
multi sub cotanh(Numeric \$x) { $x.cotanh }
multi sub cotanh(Cool \$x) { $x.Numeric.cotanh }
-proto sub acotanh(|$) {*}
+proto sub acotanh(|) {*}
multi sub acotanh(Numeric \$x) { $x.acotanh }
multi sub acotanh(Cool \$x) { $x.Numeric.acotanh }
-proto sub sqrt(|$) {*}
+proto sub sqrt(|) {*}
multi sub sqrt(Numeric \$x) { $x.sqrt }
multi sub sqrt(Cool \$x) { $x.Numeric.sqrt }
proto sub roots($, $) { * }
multi sub roots($x, Cool $n) { $x.Numeric.Complex.roots($n.Int) }
multi sub roots($x, Numeric $n) { $x.Numeric.Complex.roots($n.Int) }
-proto sub floor(|$) { * }
+proto sub floor(|) { * }
multi sub floor($a) { $a.Numeric.floor }
multi sub floor(Numeric $a) { $a.floor }
-proto sub ceiling(|$) { * }
+proto sub ceiling(|) { * }
multi sub ceiling($a) { $a.Numeric.ceiling }
multi sub ceiling(Numeric $a) { $a.ceiling }
-proto sub round(|$) { * }
+proto sub round(|) { * }
multi sub round($a) { $a.Numeric.round }
multi sub round(Numeric $a) { $a.round }
multi sub round(Numeric $a, $scale) { $a.round($scale) }
@@ -220,7 +220,7 @@ multi infix:<**>(\$a, \$b) { $a.Numeric ** $b.Numeric }
## relational operators
-proto infix:«<=>»(|$) { * }
+proto infix:«<=>»(|) { * }
multi infix:«<=>»(\$a, \$b) { $a.Real <=> $b.Real }
proto infix:<==>($a?, $b?) { * }
@@ -249,31 +249,31 @@ multi infix:«>=»(\$a, \$b) { $a.Real >= $b.Real }
## bitwise operators
-proto infix:<+&>(|$) { * }
+proto infix:<+&>(|) { * }
multi infix:<+&>() { +^0 }
multi infix:<+&>($x) { $x }
multi infix:<+&>($x, $y) { $x.Numeric.Int +& $y.Numeric.Int }
-proto infix:<+|>(|$) { * }
+proto infix:<+|>(|) { * }
multi infix:<+|>() { 0 }
multi infix:<+|>($x) { $x }
multi infix:<+|>($x, $y) { $x.Numeric.Int +| $y.Numeric.Int }
-proto infix:<+^>(|$) { * }
+proto infix:<+^>(|) { * }
multi infix:<+^>() { 0 }
multi infix:<+^>($x) { $x }
multi infix:<+^>($x, $y) { $x.Numeric.Int +^ $y.Numeric.Int }
-proto infix:«+<»(|$) { * }
+proto infix:«+<»(|) { * }
multi infix:«+<»() { fail "No zero-arg meaning for infix:«+<»"; }
multi infix:«+<»($x) { $x }
multi infix:«+<»($x,$y) { $x.Numeric.Int +< $y.Numeric.Int }
-proto infix:«+>»(|$) { * }
+proto infix:«+>»(|) { * }
multi infix:«+>»() { fail "No zero-arg meaning for infix:«+>»"; }
multi infix:«+>»($x) { $x }
multi infix:«+>»($x,$y) { $x.Numeric.Int +> $y.Numeric.Int }
-proto prefix:<+^>(|$) { * }
+proto prefix:<+^>(|) { * }
multi prefix:<+^>($x) { +^ $x.Numeric.Int }
View
6 src/core/Parcel.pm
@@ -36,7 +36,7 @@ my class Parcel does Positional {
method at_pos(Parcel:D: \$x) is rw { self.flat.at_pos($x); }
- proto method postcircumfix:<[ ]>(|$) { * }
+ proto method postcircumfix:<[ ]>(|) { * }
multi method postcircumfix:<[ ]>() is rw { self.flat }
multi method postcircumfix:<[ ]>(Parcel:D: \$x) is rw { self.flat.[$x] }
@@ -62,7 +62,7 @@ my class Parcel does Positional {
$perl ~ ')';
}
- method STORE(|$) {
+ method STORE(|) {
# get the list of rvalues to store and lhs containers
my Mu $args := pir::perl6_current_args_rpa__P();
nqp::shift($args);
@@ -114,7 +114,7 @@ my class Parcel does Positional {
}
-my sub infix:<,>(|$) {
+my sub infix:<,>(|) {
nqp::p6parcel(pir::perl6_current_args_rpa__P(), nqp::null());
}
View
6 src/core/Range.pm
@@ -4,7 +4,7 @@ class Range is Iterable does Positional {
has $.excludes_min;
has $.excludes_max;
- proto method new(|$) { * }
+ proto method new(|) { * }
multi method new($min, $max, :$excludes_min, :$excludes_max) {
nqp::create(self).BUILD($min, $max, $excludes_min, $excludes_max)
}
@@ -148,7 +148,7 @@ class Range is Iterable does Positional {
~ ')'
}
- proto method roll(|$) { * }
+ proto method roll(|) { * }
multi method roll(Range:D: Whatever) {
gather loop { take self.roll }
}
@@ -167,7 +167,7 @@ class Range is Iterable does Positional {
}
}
- proto method pick(|$) { * }
+ proto method pick(|) { * }
multi method pick() { self.roll };
multi method pick(Whatever) { self.list.pick(*) };
multi method pick(Cool $n as Int) {
View
18 src/core/Real.pm
@@ -3,7 +3,7 @@ my class Complex { ... }
my role Real does Numeric {
method Rat(Real:D: Real $epsilon = 1.0e-6) { self.Bridge.Rat($epsilon) }
method abs() { self < 0 ?? -self !! self }
- proto method sign(|$) {*}
+ proto method sign(|) {*}
multi method sign(Real:U:) { Mu }
multi method sign(Real:D:) { self < 0 ?? -1 !! self == 0 ?? 0 !! 1 }
method conj(Real:D:) { self }
@@ -15,7 +15,7 @@ my role Real does Numeric {
method acos() { self.Bridge.acos }
method tan() { self.Bridge.tan }
method atan() { self.Bridge.atan }
- proto method atan2(|$) {*}
+ proto method atan2(|) {*}
multi method atan2(Real $x = 1e0) { self.Bridge.atan2($x.Bridge) }
multi method atan2(Cool $x = 1e0) { self.Bridge.atan2($x.Numeric.Bridge) }
method sec() { self.Bridge.sec }
@@ -47,10 +47,10 @@ my role Real does Numeric {
Complex.new(self.cos, self.sin);
}
method Complex() { Complex.new(self.Num, 0e0) }
- proto method log(|$) {*}
+ proto method log(|) {*}
multi method log(Real:D: ) { self.Bridge.log }
multi method log(Real:D: Real $base) { self.Bridge.log($base.Bridge) }
- proto method exp(|$) {*}
+ proto method exp(|) {*}
multi method exp(Real:D: ) { self.Bridge.exp }
method truncate(Real:D:) {
self == 0 ?? 0 !! self < 0 ?? self.ceiling !! self.floor
@@ -85,7 +85,7 @@ my role Real does Numeric {
multi method Str(Real:D:) { self.Bridge.Str }
}
-proto sub cis(|$) {*}
+proto sub cis(|) {*}
multi sub cis(Real $a) { $a.cis }
multi infix:<+>(Real \$a, Real \$b) { $a.Bridge + $b.Bridge }
@@ -114,7 +114,7 @@ multi infix:«>=»(Real \$a, Real \$b) { $a.Bridge >= $b.Bridge }
multi prefix:<->(Real \$a) { -$a.Bridge }
-proto sub infix:<mod>(|$) {*}
+proto sub infix:<mod>(|) {*}
multi sub infix:<mod>(Real $a, Real $b) {
$a - ($a.Bridge.Int div $b.Bridge.Int) * $b;
}
@@ -123,17 +123,17 @@ multi sub abs(Real \$a) {
$a < 0 ?? -$a !! $a;
}
-proto sub truncate(|$) {*}
+proto sub truncate(|) {*}
multi sub truncate(Real:D $x) { $x.truncate }
multi sub truncate(Cool:D $x) { $x.Numeric.truncate }
-proto sub atan2(|$) { * }
+proto sub atan2(|) { * }
multi sub atan2(Real \$a, Real \$b = 1e0) { $a.Bridge.atan2($b.Bridge) }
# should really be (Cool, Cool), and then (Cool, Real) and (Real, Cool)
# candidates, but since Int both conforms to Cool and Real, we'd get lots
# of ambiguous dispatches. So just go with (Any, Any) for now.
multi sub atan2( \$a, \$b = 1e0) { $a.Numeric.atan2($b.Numeric) }
-proto sub unpolar(|$) {*}
+proto sub unpolar(|) {*}
multi sub unpolar(Real $mag, Real $angle) { $mag.unpolar($angle) }
View
2 src/core/Routine.pm
@@ -34,7 +34,7 @@ my class Routine {
nqp::bindattr($disp, Routine, '$!dispatchees', nqp::list(self));
}
# Call this lexical sub to get rid of 'self' in the signature.
- sub checker(|$) {
+ sub checker(|) {
my Mu $cap := pir::find_lex__Ps('call_sig');
pir::perl6ize_type__PP(pir::perl6_get_matching_multis__PPP($disp, $cap))
}
View
4 src/core/Str.pm
@@ -784,7 +784,7 @@ my class Str does Stringy {
}
}
- proto method triage_substitution(|$) {*}
+ proto method triage_substitution(|) {*}
multi method triage_substitution($_ where { .key ~~ Regex }) {
my $key = .key;
return unless $!source.substr($!index) ~~ $key;
@@ -802,7 +802,7 @@ my class Str does Stringy {
X::Str::Trans::IllegalKey.new(key => $_).throw;
}
- proto method increment_index(|$) {*}
+ proto method increment_index(|) {*}
multi method increment_index(Regex $s) {
$!source.substr($!index) ~~ $s;
$!index = $!next_match + $/.chars;
View
28 src/core/Stringy.pm
@@ -4,58 +4,58 @@ multi sub infix:<eqv>(Stringy $a, Stringy $b) {
$a.WHAT === $b.WHAT && ($a cmp $b) == 0
}
-proto prefix:<~>(|$) { * }
+proto prefix:<~>(|) { * }
multi prefix:<~>(\$a) { $a.Stringy }
-proto infix:<~>(|$) { * }
+proto infix:<~>(|) { * }
multi infix:<~>($x = '') { $x.Stringy }
multi infix:<~>(\$a, \$b) { $a.Stringy ~ $b.Stringy }
-proto infix:<x>(|$) { * }
+proto infix:<x>(|) { * }
multi infix:<x>() { fail "No zero-arg meaning for infix:<x>" }
multi infix:<x>($x) { $x.Stringy }
multi infix:<x>($s, $n) { $s.Stringy x $n.Int }
-proto infix:<leg>(|$) { * }
+proto infix:<leg>(|) { * }
multi infix:<leg>(\$a, \$b) { $a.Stringy cmp $b.Stringy }
-proto infix:<eq>(|$) { * }
+proto infix:<eq>(|) { * }
multi infix:<eq>($x?) { Bool::True }
multi infix:<eq>(\$a, \$b) { $a.Stringy eq $b.Stringy }
-proto infix:<ne>(|$) { * }
+proto infix:<ne>(|) { * }
multi infix:<ne>($x?) { Bool::True }
multi infix:<ne>(Mu \$a, Mu \$b) { $a !eq $b }
-proto infix:<lt>(|$) { * }
+proto infix:<lt>(|) { * }
multi infix:<lt>($x?) { Bool::True }
multi infix:<lt>(\$a, \$b) { $a.Stringy lt $b.Stringy }
-proto infix:<le>(|$) { * }
+proto infix:<le>(|) { * }
multi infix:<le>($x?) { Bool::True }
multi infix:<le>(\$a, \$b) { $a.Stringy le $b.Stringy }
-proto infix:<gt>(|$) { * }
+proto infix:<gt>(|) { * }
multi infix:<gt>($x?) { Bool::True }
multi infix:<gt>(\$a, \$b) { $a.Stringy gt $b.Stringy }
-proto infix:<ge>(|$) { * }
+proto infix:<ge>(|) { * }
multi infix:<ge>($x?) { Bool::True }
multi infix:<ge>(\$a, \$b) { $a.Stringy ge $b.Stringy }
-proto infix:<~|>(|$) { * }
+proto infix:<~|>(|) { * }
multi infix:<~|>($x = '') { $x.Stringy }
multi infix:<~|>(\$a, \$b) { $a.Stringy ~| $b.Stringy }
-proto infix:<~^>(|$) { * }
+proto infix:<~^>(|) { * }
multi infix:<~^>($x = '') { $x.Stringy }
multi infix:<~^>(\$a, \$b) { $a.Stringy ~^ $b.Stringy }
-proto infix:<~&>(|$) { * }
+proto infix:<~&>(|) { * }
multi infix:<~&>() { fail "No zero-arg meaning for infix:<~&>" }
multi infix:<~&>($x) { $x.Stringy }
multi infix:<~&>(\$a, \$b) { $a.Stringy ~& $b.Stringy }
-proto prefix:<~^>(|$) { * }
+proto prefix:<~^>(|) { * }
multi prefix:<~^>(\$a) { ~^ $a.Stringy }
View
2 src/core/Version.pm
@@ -45,7 +45,7 @@ multi sub infix:<eqv>(Version:D $a, Version:D $b) {
multi sub infix:<cmp>(Version:D $a, Version:D $b) {
- proto vnumcmp(|$) { * }
+ proto vnumcmp(|) { * }
multi vnumcmp(Str, Int) { Order::Increase }
multi vnumcmp(Int, Str) { Order::Decrease }
multi vnumcmp($av, $bv) { $av cmp $bv }
View
6 src/core/control.pm
@@ -124,7 +124,7 @@ my &lastcall := -> {
True
};
-proto sub die(|$) is hidden_from_backtrace {*};
+proto sub die(|) is hidden_from_backtrace {*};
multi sub die(Exception $e) is hidden_from_backtrace { $e.throw }
multi sub die($payload) is hidden_from_backtrace {
X::AdHoc.new(:$payload).throw
@@ -142,7 +142,7 @@ multi sub warn(*@msg) is hidden_from_backtrace {
0;
}
-proto sub eval(|$) {*}
+proto sub eval(|) {*}
multi sub eval(Str $code, :$lang = 'perl6') {
my $caller_ctx := Q:PIR {
$P0 = getinterp
@@ -208,6 +208,6 @@ sub QX($cmd) {
$result;
}
-sub EXHAUST(|$) {
+sub EXHAUST(|) {
X::ControlFlow::Return.new.throw();
}
View
2 src/core/metaops.pm
@@ -166,7 +166,7 @@ sub METAOP_HYPER_PREFIX(\$op, \$obj) { hyper($op, $obj) }
sub METAOP_HYPER_CALL(\$list, |$args) { hyper(-> $c { $c(|$args) }, $list) }
-proto sub hyper(|$) { * }
+proto sub hyper(|) { * }
multi sub hyper(\$op, \$a, \$b, :$dwim-left, :$dwim-right) {
my @alist := $a.flat;
my @blist := $b.flat;
View
8 src/core/operators.pm
@@ -7,7 +7,7 @@ sub infix:<=>(Mu \$a, Mu \$b) is rw {
pir::perl6_container_store__0PP($a, $b)
}
-proto infix:<does>(|$) { * }
+proto infix:<does>(|) { * }
multi infix:<does>(Mu:D \$obj, Mu:U \$rolish) is rw {
# XXX Mutability check.
my $role := $rolish.HOW.archetypes.composable() ?? $rolish !!
@@ -35,7 +35,7 @@ multi infix:<does>(Mu:U \$obj, @roles) is rw {
X::Does::TypeObject.new().throw
}
-proto infix:<but>(|$) { * }
+proto infix:<but>(|) { * }
multi infix:<but>(Mu:D \$obj, Mu:U \$rolish) {
my $role := $rolish.HOW.archetypes.composable() ?? $rolish !!
$rolish.HOW.archetypes.composalizable() ?? $rolish.HOW.composalize($rolish) !!
@@ -177,10 +177,10 @@ sub WHAT(\$x) {
$x.WHAT
}
-proto sub infix:<...>(|$) { * }
+proto sub infix:<...>(|) { * }
multi sub infix:<...>($a, $b) { SEQUENCE($a, $b) }
-proto sub infix:<...^>(|$) { * }
+proto sub infix:<...^>(|) { * }
multi sub infix:<...^>($a, $b) { SEQUENCE($a, $b, :exclude_end(1)) }
sub undefine(Mu \$x) {
View
16 src/core/traits.pm
@@ -17,7 +17,7 @@ my class X::Composition::NotComposable { ... }
my class X::Import::MissingSymbols { ... }
my class X::Redeclaration { ... }
-proto trait_mod:<is>(|$) { * }
+proto trait_mod:<is>(|) { * }
multi trait_mod:<is>(Mu:U $child, Mu:U $parent) {
if $parent.HOW.archetypes.inheritable() {
$child.HOW.add_parent($child, $parent);
@@ -141,7 +141,7 @@ multi trait_mod:<is>(Mu:U $docee, :$docs!) {
}
-proto trait_mod:<does>(|$) { * }
+proto trait_mod:<does>(|) { * }
multi trait_mod:<does>(Mu:U $doee, Mu:U $role) {
if $role.HOW.archetypes.composable() {
$doee.HOW.add_role($doee, $role)
@@ -157,7 +157,7 @@ multi trait_mod:<does>(Mu:U $doee, Mu:U $role) {
}
}
-proto trait_mod:<of>(|$) { * }
+proto trait_mod:<of>(|) { * }
multi trait_mod:<of>(Mu:U $target, Mu:U $type) {
# XXX Ensure we can do this, die if not.
$target.HOW.set_of($target, $type);
@@ -177,7 +177,7 @@ multi trait_mod:<is>(Routine:D $r, :$hidden_from_backtrace!) {
}
-proto trait_mod:<returns>(|$) { * }
+proto trait_mod:<returns>(|) { * }
multi trait_mod:<returns>(Routine:D $target, Mu:U $type) {
my $sig := $target.signature;
X::Redeclaration.new(what => 'return type for', symbol => $target,
@@ -186,13 +186,13 @@ multi trait_mod:<returns>(Routine:D $target, Mu:U $type) {
$sig.set_returns($type)
}
-proto trait_mod:<as>(|$) { * }
+proto trait_mod:<as>(|) { * }
multi trait_mod:<as>(Parameter:D $param, $type) {
$param.set_coercion($type);
}
my class Pair { ... }
-proto trait_mod:<handles>(|$) { * }
+proto trait_mod:<handles>(|) { * }
multi trait_mod:<handles>(Attribute:D $target, $thunk) {
$target does role {
has $.handles;
@@ -253,12 +253,12 @@ multi trait_mod:<handles>(Attribute:D $target, $thunk) {
$target.set_handles($thunk());
}
-proto trait_mod:<will>(|$) { * }
+proto trait_mod:<will>(|) { * }
multi trait_mod:<will>(Attribute $attr, Block :$build!) {
$attr.set_build($build)
}
-proto trait_mod:<trusts>(|$) { * }
+proto trait_mod:<trusts>(|) { * }
multi trait_mod:<trusts>(Mu:U $truster, Mu:U $trustee) {
$truster.HOW.add_trustee($truster, $trustee);
}

0 comments on commit 53c7856

Please sign in to comment.
Something went wrong with that request. Please try again.