Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

infix cmp for Pairs

  • Loading branch information...
commit 59ec8c6a6b134b094c0c099d5648c3df8e2a4b96 1 parent a2b9926
Moritz Lenz moritz authored
Showing with 5 additions and 1 deletion.
  1. +4 −0 src/core/Pair.pm
  2. +1 −1  t/spectest.data
4 src/core/Pair.pm
View
@@ -5,3 +5,7 @@ my class Pair is Enum does Associative {
sub infix:«=>»($key, Mu $value) {
Pair.new(:key($key), :value($value))
}
+
+multi infix:<cmp>(Pair \$a, Pair \$b) {
+ ($a.key cmp $b.key) || ($a.value cmp $b.value)
+}
2  t/spectest.data
View
@@ -134,7 +134,7 @@ S03-operators/binding-closure.t
# S03-operators/brainos.t
# S03-operators/buf.t
S03-operators/chained-declarators.t
-# S03-operators/cmp.t
+S03-operators/cmp.t
# S03-operators/comparison.t # need Order::Increase
S03-operators/comparison-simple.t
# S03-operators/context-forcers.t # need True
Please sign in to comment.
Something went wrong with that request. Please try again.