Permalink
Browse files

potentially constant-fold more stringy operators

  • Loading branch information...
1 parent a9f3c63 commit 0d3c9b08fd28214d34f68fb222ae39aad84c16f0 @moritz moritz committed May 14, 2013
Showing with 12 additions and 12 deletions.
  1. +12 −12 src/core/Stringy.pm
View
@@ -4,7 +4,7 @@ multi sub infix:<eqv>(Stringy:D $a, Stringy:D $b) {
$a.WHAT === $b.WHAT && ($a cmp $b) == 0
}
-proto prefix:<~>($) { * }
+proto prefix:<~>($) is pure { * }
multi prefix:<~>(\a) { a.Stringy }
proto infix:<~>($?, $?) is pure { * }
@@ -16,46 +16,46 @@ 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 // 0) }
-proto infix:<leg>($?, $?) { * }
+proto infix:<leg>($?, $?) is pure { * }
multi infix:<leg>(\a, \b) { a.Stringy cmp b.Stringy }
-proto infix:<eq>($?, $?) { * }
+proto infix:<eq>($?, $?) is pure { * }
multi infix:<eq>($x?) { Bool::True }
multi infix:<eq>(\a, \b) { a.Stringy eq b.Stringy }
-proto infix:<ne>(Mu $?, Mu $?) { * }
+proto infix:<ne>(Mu $?, Mu $?) is pure { * }
multi infix:<ne>($x?) { Bool::True }
multi infix:<ne>(Mu \a, Mu \b) { a !eq b }
-proto infix:<lt>($?, $?) { * }
+proto infix:<lt>($?, $?) is pure { * }
multi infix:<lt>($x?) { Bool::True }
multi infix:<lt>(\a, \b) { a.Stringy lt b.Stringy }
-proto infix:<le>($?, $?) { * }
+proto infix:<le>($?, $?) is pure { * }
multi infix:<le>($x?) { Bool::True }
multi infix:<le>(\a, \b) { a.Stringy le b.Stringy }
-proto infix:<gt>($?, $?) { * }
+proto infix:<gt>($?, $?) is pure { * }
multi infix:<gt>($x?) { Bool::True }
multi infix:<gt>(\a, \b) { a.Stringy gt b.Stringy }
-proto infix:<ge>($?, $?) { * }
+proto infix:<ge>($?, $?) is pure { * }
multi infix:<ge>($x?) { Bool::True }
multi infix:<ge>(\a, \b) { a.Stringy ge b.Stringy }
-proto infix:<~|>($?, $?) { * }
+proto infix:<~|>($?, $?) is pure { * }
multi infix:<~|>($x = '') { $x.Stringy }
multi infix:<~|>(\a, \b) { a.Stringy ~| b.Stringy }
-proto infix:<~^>($?, $?) { * }
+proto infix:<~^>($?, $?) is pure { * }
multi infix:<~^>($x = '') { $x.Stringy }
multi infix:<~^>(\a, \b) { a.Stringy ~^ b.Stringy }
-proto infix:<~&>($?, $?) { * }
+proto infix:<~&>($?, $?) is pure { * }
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:<~^>($?, $?) is pure { * }
multi prefix:<~^>(\a) { ~^ a.Stringy }

0 comments on commit 0d3c9b0

Please sign in to comment.