tech.v3.datatype.functional unexpectedly throws a ClassCastException when comparing certain numeric types (e.g. doubles and longs, as in (tech.v3.datatype.functional/> 3.0 2)) instead of performing the comparison as expected. Most users would typically expect numeric types to "just work" together without any issues.
The root cause appears to be that the library is delegating to Java's Comparable interface for performing certain comparisons, which does not allow for mixing different numeric types like floats/doubles and longs. This is in contrast to Clojure's built-in numeric comparison functions, which handle these kinds of mixed numeric types without issue.
In the discussion in this thread it was confirmed that object pathways are supposed to delegate to Clojure, and some suggested solutions were proposed, including:
delegate to Clojure's built-in numeric comparison functions when performing comparisons on the object pathway (preferred solution)
implement a custom comparison function within the library that can handle mixed numeric types correctly
document this as a gotcha with guidance on how to work around it (not preferred)
tech.v3.datatype.functional
unexpectedly throws aClassCastException
when comparing certain numeric types (e.g. doubles and longs, as in(tech.v3.datatype.functional/> 3.0 2)
) instead of performing the comparison as expected. Most users would typically expect numeric types to "just work" together without any issues.The root cause appears to be that the library is delegating to Java's
Comparable
interface for performing certain comparisons, which does not allow for mixing different numeric types like floats/doubles and longs. This is in contrast to Clojure's built-in numeric comparison functions, which handle these kinds of mixed numeric types without issue.In the discussion in this thread it was confirmed that object pathways are supposed to delegate to Clojure, and some suggested solutions were proposed, including: