Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement eqv for Enum (and thus Pair).
  • Loading branch information
jnthn committed Aug 3, 2011
1 parent 1519560 commit 8443d11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/Any.pm
Expand Up @@ -130,6 +130,9 @@ proto sub infix:<eqv>(Mu $, Mu $) { * }
multi sub infix:<eqv>(Mu $a, Mu $b) {
$a.WHAT === $b.WHAT && $a === $b
}
multi sub infix:<eqv>(Enum:D $a, Enum:D $b) {
$a.WHAT === $b.WHAT && $a.key eqv $b.key && $a.value eqv $b.value
}
multi sub infix:<eqv>(@a, @b) {
unless @a.WHAT === @b.WHAT && @a.elems == @b.elems {
return Bool::False
Expand Down
1 change: 1 addition & 0 deletions src/core/stubs.pm
Expand Up @@ -7,6 +7,7 @@ my class Whatever is Cool { ... }
my class WhateverCode is Code { ... }
my role Stringy { ... }
my class IO { ... }
my class Enum { ... }
my class Bag is Iterable does Associative { }
my class Buf is Iterable does Positional { }
my class Set is Iterable does Associative { }
Expand Down

0 comments on commit 8443d11

Please sign in to comment.