uncomplicate / neanderthal

Fast Clojure Matrix Library
http://neanderthal.uncomplicate.org
Eclipse Public License 1.0
1.06k stars 56 forks source link

MINOR - abs warning on clojure 1.11+ #129

Open cnuernber opened 1 year ago

cnuernber commented 1 year ago

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
blueberry commented 1 year ago

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.

cnuernber commented 1 year ago

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.

blueberry commented 1 year ago

Thanks for the solution.