Skip to content

Commit

Permalink
implement infix:<eqv>(Rat, Rat)
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Sep 22, 2009
1 parent c584dc6 commit 0220cc2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/setting/Operators.pm
Expand Up @@ -27,6 +27,9 @@ multi sub infix:<...> (@lhs, Code $generator) {
multi sub infix:<eqv> (Num $a, Num $b) { $a === $b }
multi sub infix:<eqv> (Str $a, Str $b) { $a === $b }
multi sub infix:<eqv> (Code $a, Code $b) { $a === $b }
multi sub infix:<eqv> (Rat $a, Rat $b) {
$a.numerator === $b.numerator && $a.denominator == $b.denominator
};
multi sub infix:<eqv> (Positional $a, Positional $b) {
return Bool::False unless $a.WHAT === $b.WHAT;
return Bool::False unless $a.elems == $b.elems;
Expand Down

0 comments on commit 0220cc2

Please sign in to comment.