Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Increase/Decrease -> Less/More migration

As per recent spec change.  Added Increase/Decrease as DEPRECATED subs.  Not
sure how I can add Order::Increase/Order::Decrease as DEPRECATED subs  :-(
  • Loading branch information...
commit 132a970753c6e4bd43f2a25dc8e4ac484e9039f5 1 parent 5bd51cb
@lizmat lizmat authored
Showing with 8 additions and 5 deletions.
  1. +6 −3 src/core/Order.pm
  2. +2 −2 src/core/Version.pm
View
9 src/core/Order.pm
@@ -1,10 +1,13 @@
## Order enumeration, for cmp and <=>
-my enum Order (:Increase(-1), :Same(0), :Decrease(1));
+my enum Order (:Less(-1), :Same(0), :More(1));
+
+sub Increase { DEPRECATED("Less"); Less }
+sub Decrease { DEPRECATED("More"); More }
proto infix:<cmp>($, $) { * }
multi infix:<cmp>(\a, \b) {
- return Order::Increase if a === -$Inf || b === $Inf;
- return Order::Decrease if a === $Inf || b === -$Inf;
+ return Order::Less if a === -$Inf || b === $Inf;
+ return Order::More if a === $Inf || b === -$Inf;
a.Stringy cmp b.Stringy
}
multi infix:<cmp>(Real \a, Real \b) { a.Bridge cmp b.Bridge }
View
4 src/core/Version.pm
@@ -46,8 +46,8 @@ multi sub infix:<eqv>(Version:D $a, Version:D $b) {
multi sub infix:<cmp>(Version:D $a, Version:D $b) {
proto vnumcmp(|) { * }
- multi vnumcmp(Str, Int) { Order::Increase }
- multi vnumcmp(Int, Str) { Order::Decrease }
+ multi vnumcmp(Str, Int) { Order::Less }
+ multi vnumcmp(Int, Str) { Order::More }
multi vnumcmp($av, $bv) { $av cmp $bv }
my @av = $a.parts.values;
Please sign in to comment.
Something went wrong with that request. Please try again.