Browse files

switch Numeric to sigilless params

  • Loading branch information...
1 parent 234ad61 commit 1f6fe8154a875750aef166ce35045b5099ba3db1 @moritz moritz committed Aug 14, 2012
Showing with 75 additions and 75 deletions.
  1. +4 −4 src/core/GatherIter.pm
  2. +2 −2 src/core/List.pm
  3. +69 −69 src/core/Numeric.pm
View
8 src/core/GatherIter.pm
@@ -41,10 +41,10 @@ class GatherIter is Iterator {
method infinite() { $!infinite }
- my sub coro(\$block) {
+ my sub coro(\block) {
Q:PIR {
.local pmc block, handler, taken
- block = find_lex '$block'
+ block = find_lex 'block'
.yield ()
handler = root_new ['parrot';'ExceptionHandler']
handler.'handle_types'(.CONTROL_TAKE)
@@ -71,7 +71,7 @@ class GatherIter is Iterator {
}
-sub GATHER(\$block, Mu :$infinite) {
- GatherIter.new( $block, :$infinite ).list;
+sub GATHER(\block, Mu :$infinite) {
+ GatherIter.new( block, :$infinite ).list;
}
View
4 src/core/List.pm
@@ -394,10 +394,10 @@ proto sub shift(|) {*}
multi sub shift(@a) { @a.shift }
proto sub unshift(|) {*}
-multi sub unshift(\$a, *@elems) { $a.unshift: @elems }
+multi sub unshift(\a, *@elems) { a.unshift: @elems }
proto sub push(|) {*}
-multi sub push(\$a, *@elems) { $a.push: @elems }
+multi sub push(\a, *@elems) { a.push: @elems }
sub reverse(*@a) { @a.reverse }
sub rotate(@a, Int $n = 1) { @a.rotate($n) }
View
138 src/core/Numeric.pm
@@ -38,11 +38,11 @@ proto prefix:<->(|) { * }
multi prefix:<->(\$a) { -$a.Numeric }
proto sub abs(|) { * }
-multi sub abs(\$a) { abs $a.Numeric }
+multi sub abs(\a) { abs a.Numeric }
proto sub sign(|) {*}
-multi sub sign(Numeric \$x) { $x.sign }
-multi sub sign(Cool \$x) { $x.Numeric.sign }
+multi sub sign(Numeric \x) { x.sign }
+multi sub sign(Cool \x) { x.Numeric.sign }
proto sub log(|) {*}
multi sub log(Numeric $x) { $x.log }
@@ -59,104 +59,104 @@ multi sub exp(Numeric $x) { $x.exp }
multi sub exp(Numeric $x, Numeric $base) { $x.exp($base) }
proto sub sin(|) {*}
-multi sub sin(Numeric \$x) { $x.sin }
-multi sub sin(Cool \$x) { $x.Numeric.sin }
+multi sub sin(Numeric \x) { x.sin }
+multi sub sin(Cool \x) { x.Numeric.sin }
proto sub asin(|) {*}
-multi sub asin(Numeric \$x) { $x.asin }
-multi sub asin(Cool \$x) { $x.Numeric.asin }
+multi sub asin(Numeric \x) { x.asin }
+multi sub asin(Cool \x) { x.Numeric.asin }
proto sub cos(|) {*}
-multi sub cos(Numeric \$x) { $x.cos }
-multi sub cos(Cool \$x) { $x.Numeric.cos }
+multi sub cos(Numeric \x) { x.cos }
+multi sub cos(Cool \x) { x.Numeric.cos }
proto sub acos(|) {*}
-multi sub acos(Numeric \$x) { $x.acos }
-multi sub acos(Cool \$x) { $x.Numeric.acos }
+multi sub acos(Numeric \x) { x.acos }
+multi sub acos(Cool \x) { x.Numeric.acos }
proto sub tan(|) {*}
-multi sub tan(Numeric \$x) { $x.tan }
-multi sub tan(Cool \$x) { $x.Numeric.tan }
+multi sub tan(Numeric \x) { x.tan }
+multi sub tan(Cool \x) { x.Numeric.tan }
proto sub atan(|) {*}
-multi sub atan(Numeric \$x) { $x.atan }
-multi sub atan(Cool \$x) { $x.Numeric.atan }
+multi sub atan(Numeric \x) { x.atan }
+multi sub atan(Cool \x) { x.Numeric.atan }
proto sub sec(|) {*}
-multi sub sec(Numeric \$x) { $x.sec }
-multi sub sec(Cool \$x) { $x.Numeric.sec }
+multi sub sec(Numeric \x) { x.sec }
+multi sub sec(Cool \x) { x.Numeric.sec }
proto sub asec(|) {*}
-multi sub asec(Numeric \$x) { $x.asec }
-multi sub asec(Cool \$x) { $x.Numeric.asec }
+multi sub asec(Numeric \x) { x.asec }
+multi sub asec(Cool \x) { x.Numeric.asec }
proto sub cosec(|) {*}
-multi sub cosec(Numeric \$x) { $x.cosec }
-multi sub cosec(Cool \$x) { $x.Numeric.cosec }
+multi sub cosec(Numeric \x) { x.cosec }
+multi sub cosec(Cool \x) { x.Numeric.cosec }
proto sub acosec(|) {*}
-multi sub acosec(Numeric \$x) { $x.acosec }
-multi sub acosec(Cool \$x) { $x.Numeric.acosec }
+multi sub acosec(Numeric \x) { x.acosec }
+multi sub acosec(Cool \x) { x.Numeric.acosec }
proto sub cotan(|) {*}
-multi sub cotan(Numeric \$x) { $x.cotan }
-multi sub cotan(Cool \$x) { $x.Numeric.cotan }
+multi sub cotan(Numeric \x) { x.cotan }
+multi sub cotan(Cool \x) { x.Numeric.cotan }
proto sub acotan(|) {*}
-multi sub acotan(Numeric \$x) { $x.acotan }
-multi sub acotan(Cool \$x) { $x.Numeric.acotan }
+multi sub acotan(Numeric \x) { x.acotan }
+multi sub acotan(Cool \x) { x.Numeric.acotan }
proto sub sinh(|) {*}
-multi sub sinh(Numeric \$x) { $x.sinh }
-multi sub sinh(Cool \$x) { $x.Numeric.sinh }
+multi sub sinh(Numeric \x) { x.sinh }
+multi sub sinh(Cool \x) { x.Numeric.sinh }
proto sub asinh(|) {*}
-multi sub asinh(Numeric \$x) { $x.asinh }
-multi sub asinh(Cool \$x) { $x.Numeric.asinh }
+multi sub asinh(Numeric \x) { x.asinh }
+multi sub asinh(Cool \x) { x.Numeric.asinh }
proto sub cosh(|) {*}
-multi sub cosh(Numeric \$x) { $x.cosh }
-multi sub cosh(Cool \$x) { $x.Numeric.cosh }
+multi sub cosh(Numeric \x) { x.cosh }
+multi sub cosh(Cool \x) { x.Numeric.cosh }
proto sub acosh(|) {*}
-multi sub acosh(Numeric \$x) { $x.acosh }
-multi sub acosh(Cool \$x) { $x.Numeric.acosh }
+multi sub acosh(Numeric \x) { x.acosh }
+multi sub acosh(Cool \x) { x.Numeric.acosh }
proto sub tanh(|) {*}
-multi sub tanh(Numeric \$x) { $x.tanh }
-multi sub tanh(Cool \$x) { $x.Numeric.tanh }
+multi sub tanh(Numeric \x) { x.tanh }
+multi sub tanh(Cool \x) { x.Numeric.tanh }
proto sub atanh(|) {*}
-multi sub atanh(Numeric \$x) { $x.atanh }
-multi sub atanh(Cool \$x) { $x.Numeric.atanh }
+multi sub atanh(Numeric \x) { x.atanh }
+multi sub atanh(Cool \x) { x.Numeric.atanh }
proto sub sech(|) {*}
-multi sub sech(Numeric \$x) { $x.sech }
-multi sub sech(Cool \$x) { $x.Numeric.sech }
+multi sub sech(Numeric \x) { x.sech }
+multi sub sech(Cool \x) { x.Numeric.sech }
proto sub asech(|) {*}
-multi sub asech(Numeric \$x) { $x.asech }
-multi sub asech(Cool \$x) { $x.Numeric.asech }
+multi sub asech(Numeric \x) { x.asech }
+multi sub asech(Cool \x) { x.Numeric.asech }
proto sub cosech(|) {*}
-multi sub cosech(Numeric \$x) { $x.cosech }
-multi sub cosech(Cool \$x) { $x.Numeric.cosech }
+multi sub cosech(Numeric \x) { x.cosech }
+multi sub cosech(Cool \x) { x.Numeric.cosech }
proto sub acosech(|) {*}
-multi sub acosech(Numeric \$x) { $x.acosech }
-multi sub acosech(Cool \$x) { $x.Numeric.acosech }
+multi sub acosech(Numeric \x) { x.acosech }
+multi sub acosech(Cool \x) { x.Numeric.acosech }
proto sub cotanh(|) {*}
-multi sub cotanh(Numeric \$x) { $x.cotanh }
-multi sub cotanh(Cool \$x) { $x.Numeric.cotanh }
+multi sub cotanh(Numeric \x) { x.cotanh }
+multi sub cotanh(Cool \x) { x.Numeric.cotanh }
proto sub acotanh(|) {*}
-multi sub acotanh(Numeric \$x) { $x.acotanh }
-multi sub acotanh(Cool \$x) { $x.Numeric.acotanh }
+multi sub acotanh(Numeric \x) { x.acotanh }
+multi sub acotanh(Cool \x) { x.Numeric.acotanh }
proto sub sqrt(|) {*}
-multi sub sqrt(Numeric \$x) { $x.sqrt }
-multi sub sqrt(Cool \$x) { $x.Numeric.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) }
@@ -177,75 +177,75 @@ multi sub round(Numeric $a, $scale) { $a.round($scale) }
proto infix:<+>($a?, $b?) { * }
multi infix:<+>($x = 0) { $x.Numeric }
-multi infix:<+>(\$a, \$b) { $a.Numeric + $b.Numeric }
+multi infix:<+>(\a, \b) { a.Numeric + b.Numeric }
proto infix:<->($a?, $b?) { * }
multi infix:<->($x = 0) { $x.Numeric }
-multi infix:<->(\$a, \$b) { $a.Numeric - $b.Numeric }
+multi infix:<->(\a, \b) { a.Numeric - b.Numeric }
proto infix:<*>($a?, $b?) { * }
multi infix:<*>($x = 1) { $x.Numeric }
-multi infix:<*>(\$a, \$b) { $a.Numeric * $b.Numeric }
+multi infix:<*>(\a, \b) { a.Numeric * b.Numeric }
proto infix:</>($a?, $b?) { * }
multi infix:</>() { fail "No zero-arg meaning for infix:</>" }
multi infix:</>($x) { $x.Numeric }
-multi infix:</>(\$a, \$b) { $a.Numeric / $b.Numeric }
+multi infix:</>(\a, \b) { a.Numeric / b.Numeric }
proto infix:<div>($a?, $b?) { * }
# rest of infix:<div> is in Int.pm
proto infix:<%>($a?, $b?) { * }
multi infix:<%>() { fail "No zero-arg meaning for infix:<%>" }
multi infix:<%>($x) { $x }
-multi infix:<%>(\$a, \$b) { $a.Real % $b.Real }
+multi infix:<%>(\a, \b) { a.Real % b.Real }
proto infix:<%%>($a?, $b?) { * }
multi infix:<%%>() { fail "No zero-arg meaning for infix:<%%>" }
multi infix:<%%>($x) { Bool::True }
-multi infix:<%%>(\$a, \$b) { $a.Real % $b.Real == 0 }
+multi infix:<%%>(\a, \b) { a.Real % b.Real == 0 }
proto infix:<lcm>($a?, $b?) { * }
multi infix:<lcm>(Int $x = 1) { $x }
-multi infix:<lcm>(\$a, \$b) { $a.Int lcm $b.Int }
+multi infix:<lcm>(\a, \b) { a.Int lcm b.Int }
proto infix:<gcd>($a?, $b?) { * }
multi infix:<gcd>() { fail 'No zero-arg meaning for infix:<gcd>' }
multi infix:<gcd>(Int $x) { $x }
-multi infix:<gcd>(\$a, \$b) { $a.Int gcd $b.Int }
+multi infix:<gcd>(\a, \b) { a.Int gcd b.Int }
proto infix:<**>($a?, $b?) { * }
multi infix:<**>($x = 1) { $x.Numeric }
-multi infix:<**>(\$a, \$b) { $a.Numeric ** $b.Numeric }
+multi infix:<**>(\a, \b) { a.Numeric ** b.Numeric }
## relational operators
proto infix:«<=>»(|) { * }
-multi infix:«<=>»(\$a, \$b) { $a.Real <=> $b.Real }
+multi infix:«<=>»(\a, \b) { a.Real <=> b.Real }
proto infix:<==>($a?, $b?) { * }
multi infix:<==>($x?) { Bool::True }
-multi infix:<==>(\$a, \$b) { $a.Numeric == $b.Numeric }
+multi infix:<==>(\a, \b) { a.Numeric == b.Numeric }
proto infix:<!=>(Mu $a?, Mu $b?) { * }
multi infix:<!=>($x?) { Bool::True }
-multi infix:<!=>(Mu \$a, Mu \$b) { not $a == $b }
+multi infix:<!=>(Mu \a, Mu \b) { not a == b }
proto infix:«<»($a?, $b?) { * }
multi infix:«<»($x?) { Bool::True }
-multi infix:«<»(\$a, \$b) { $a.Real < $b.Real }
+multi infix:«<»(\a, \b) { a.Real < b.Real }
proto infix:«<=»($a?, $b?) { * }
multi infix:«<=»($x?) { Bool::True }
-multi infix:«<=»(\$a, \$b) { $a.Real <= $b.Real }
+multi infix:«<=»(\a, \b) { a.Real <= b.Real }
proto infix:«>»($a?, $b?) { * }
multi infix:«>»($x?) { Bool::True }
-multi infix:«>»(\$a, \$b) { $a.Real > $b.Real }
+multi infix:«>»(\a, \b) { a.Real > b.Real }
proto infix:«>=»($a?, $b?) { * }
multi infix:«>=»($x?) { Bool::True }
-multi infix:«>=»(\$a, \$b) { $a.Real >= $b.Real }
+multi infix:«>=»(\a, \b) { a.Real >= b.Real }
## bitwise operators

0 comments on commit 1f6fe81

Please sign in to comment.