From b908cb5b0a605165ab9e216b56f49b0cabd77224 Mon Sep 17 00:00:00 2001 From: Jake Zerrer Date: Wed, 26 Nov 2025 15:10:20 -0500 Subject: Coerce ratios to longs in some cases --- src/unheard/interval.clj | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/unheard/interval.clj b/src/unheard/interval.clj index 2ec5645..c10161c 100644 --- a/src/unheard/interval.clj +++ b/src/unheard/interval.clj @@ -5,8 +5,16 @@ (deftype RatioValueInterval [start end value] IInterval - (getNormStart [_] start) - (getNormEnd [_] end) + ;; HACK: coerce start to long to work around + ;; class clojure.lang.BigInt cannot be cast to class java.lang.Comparable + (getNormStart [_] (if (instance? clojure.lang.BigInt start) + (long start) + start)) + ;; HACK: coerce start to long to work around + ;; class clojure.lang.BigInt cannot be cast to class java.lang.Comparable + (getNormEnd [_] (if (instance? clojure.lang.BigInt end) + (long end) + end)) (getUniqueIdentifier [_] (str "[" start "," end "]")) (compareTo [_ other] (let [start-cmp (compare start (.getNormStart ^RatioValueInterval other))] -- cgit v1.2.3