neanderthal icon indicating copy to clipboard operation
neanderthal copied to clipboard

MINOR - abs warning on clojure 1.11+

Open cnuernber opened this issue 3 years ago • 3 comments

1.11 and beyond include an abs function leading to these warning:

WARNING: abs already refers to: #'clojure.core/abs in namespace: uncomplicate.neanderthal.math, being replaced by: #'uncomplicate.neanderthal.math/abs
Warning: protocol #'uncomplicate.neanderthal.internal.api/VectorMath is overwriting function abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: uncomplicate.neanderthal.internal.api, being replaced by: #'uncomplicate.neanderthal.internal.api/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: uncomplicate.neanderthal.internal.host.buffer-block, being replaced by: #'uncomplicate.neanderthal.internal.api/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: uncomplicate.neanderthal.internal.common, being replaced by: #'uncomplicate.neanderthal.internal.api/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: uncomplicate.neanderthal.internal.printing, being replaced by: #'uncomplicate.neanderthal.internal.api/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: uncomplicate.neanderthal.internal.navigation, being replaced by: #'uncomplicate.neanderthal.internal.api/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: uncomplicate.neanderthal.internal.host.mkl, being replaced by: #'uncomplicate.neanderthal.internal.api/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: uncomplicate.neanderthal.internal.host.lapack, being replaced by: #'uncomplicate.neanderthal.math/abs

cnuernber avatar Sep 15 '22 21:09 cnuernber

Thank you for reporting. I am aware of this, but I am not sure how to remove this warning, since the (vectorized) function abs is not covered by Clojure's abs, and if I exclude Clojure's abs, it would only work with Clojure 1.11+ (Clojure didn't have abs at the time when I introduced it), and the earlier Clojure will throw error. Any suggestions welcome.

blueberry avatar Sep 18 '22 11:09 blueberry

10.X according to my testing will not throw an error:

(base) chrisn@chrisn-lt3:~$ clj --version
Clojure CLI version 1.10.3.1075
(base) chrisn@chrisn-lt3:~$ clj
Clojure 1.10.3
(ns foo (:refer-clojure :exclude [a b c d e f g]))
nil
foo=>

So it kind of depends on how far back you want to go - my fix for dtype-next which has abs and finite? and infinite? was to just exclude them. I did not test this with 10.9.

cnuernber avatar Sep 18 '22 12:09 cnuernber

Thanks for the solution.

blueberry avatar Sep 18 '22 13:09 blueberry