Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
also compare ranges against lists wisely
  • Loading branch information
TimToady committed Nov 28, 2015
1 parent 45cfb29 commit 474db4c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/Range.pm
Expand Up @@ -552,4 +552,7 @@ multi sub infix:<cmp>(Range:D \a, Range:D \b) returns Order:D {
multi sub infix:<cmp>(Num(Real) \a, Range:D \b) returns Order:D { (a..a) cmp b }
multi sub infix:<cmp>(Range:D \a, Num(Real) \b) returns Order:D { a cmp (b..b) }

multi sub infix:<cmp>(Positional \a, Range:D \b) returns Order:D { a cmp b.list }
multi sub infix:<cmp>(Range:D \a, Positional \b) returns Order:D { a.list cmp b }

# vim: ft=perl6 expandtab sw=4

0 comments on commit 474db4c

Please sign in to comment.