user=> (case -1 -1 true false)
true
user=> (case [-1] [-1] true false)
true
user=> (case (int -1) -1 true false)
true
user=> (case [(int 1)] [1] true false)
true
user=> (case [(int -1)] [-1] true false)
false
The last case should return true like the other,
Real life example that triggered this:
(case [">" (compare 2 3)]
[">" -1] true
false) ;; false?
Explaination: This is caused by case
using hashCode
instead of hashEq for hash comparisons (when not wrapped in a vector, the comparison is direct) and the fact that negative integers and negative longs hash differently while positive ones hash identical.
Porposal: Make case
use hasheq instead of hashCode
Patch: 0001-switch-to-hasheq-for-case.patch