Skip to content

Commit

Permalink
Temporary fix for RT #131626
Browse files Browse the repository at this point in the history
Since the code for the ops is actually pretty limited, it feels like
a good temporary solution to just copy the code for the non-Texas
versions of !=, <= and >=.  Once we can have proper aliasing of infix
ops in the setting, that also get optimized the same way, the alternate
versions should be replaced by said aliases.
  • Loading branch information
lizmat committed Jun 23, 2017
1 parent 4079f7b commit a13bad9
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions src/core/Numeric.pm
Original file line number Diff line number Diff line change
Expand Up @@ -286,28 +286,34 @@ multi sub infix:<≅>(\a, \b, :$tolerance = $*TOLERANCE) {
}
sub infix:<=~=>(|c) { infix:<>(|c) }

proto sub infix:<!=>(Mu $?, Mu $?) is pure { * }
multi sub infix:<!=>($?) { Bool::True }
multi sub infix:<!=>(Mu \a, Mu \b) { not a == b }
sub infix:<>(|c) is pure { infix:<!=>(|c) }

proto sub infix<»(Mu $?, Mu $?) is pure { * }
multi sub infix<»($?) { Bool::True }
multi sub infix<»(\a, \b) { a.Real < b.Real }

proto sub infix<=»(Mu $?, Mu $?) is pure { * }
multi sub infix<=»($?) { Bool::True }
multi sub infix<=»(\a, \b) { a.Real <= b.Real }
sub infix:«≤»(|c) is pure { infix:«<=»(|c) }

proto sub infix>»(Mu $?, Mu $?) is pure { * }
multi sub infix>»($?) { Bool::True }
multi sub infix>»(\a, \b) { a.Real > b.Real }

proto sub infix>=»(Mu $?, Mu $?) is pure { * }
multi sub infix>=»($?) { Bool::True }
multi sub infix>=»(\a, \b) { a.Real >= b.Real }
sub infix:«≥»(|c) is pure { infix:«>=»(|c) }
proto sub infix:<!=>(Mu $?, Mu $?) is pure { * }
multi sub infix:<!=>($? --> True) { }
multi sub infix:<!=>(Mu \a, Mu \b) { not a == b }
proto sub infix:<>(Mu $?, Mu $?) is pure { * } # should be alias, RT 131626
multi sub infix:<>($? --> True) { }
multi sub infix:<>(Mu \a, Mu \b) { not a == b }

proto sub infix<»(Mu $?, Mu $?) is pure { * }
multi sub infix<»($? --> True) { }
multi sub infix<»(\a, \b) { a.Real < b.Real }

proto sub infix<=»(Mu $?, Mu $?) is pure { * }
multi sub infix<=»($? --> True) { }
multi sub infix<=»(\a, \b) { a.Real <= b.Real }
proto sub infix:«≤»(Mu $?, Mu $?) is pure { * } # should be alias, RT 131626
multi sub infix:«≤»($? --> True) { }
multi sub infix:«≤»(\a, \b) { a.Real <= b.Real }

proto sub infix>»(Mu $?, Mu $?) is pure { * }
multi sub infix>»($? --> True) { }
multi sub infix>»(\a, \b) { a.Real > b.Real }

proto sub infix>=»(Mu $?, Mu $?) is pure { * }
multi sub infix>=»($? --> True) { }
multi sub infix>=»(\a, \b) { a.Real >= b.Real }
proto sub infix:«≥»(Mu $?, Mu $?) is pure { * } # should be alias, RT 131626
multi sub infix:«≥»($? --> True) { }
multi sub infix:«≥»(\a, \b) { a.Real >= b.Real }

## bitwise operators

Expand Down

0 comments on commit a13bad9

Please sign in to comment.