Closed chrysophylax closed 2 years ago
I think it is important to understand first what the tech.v3.datatype.function namespace is in fact providing before we decide what is necessary or otherwise. From the namespace documentation:
Arithmetic and statistical operations based on the Buffer interface. These operators and functions all implement vectorized interfaces so passing in something convertible to a reader will return a reader. Arithmetic operations are done lazily. These functions generally incur a large dispatch cost so for example each call to '+' checks all the arguments to decide if it should dispatch to an iterable implementation or to a reader implementation. For tight loops or operations like map and filter, using the specific operators will result in far faster code than using the '+' function itself.
These operations are all vectorized
in that they can take a single scalar or efficiently take reader/buffer/vector type data such as a dataset column. They then return a lazy noncaching but countable result that will calculate the result upon read.
So they aren't anywhere near the same as any of the builtin functions - which only take scalars and are generally fairly inefficient as they have to always check the type of the input and dispatch on that - something that I mention in all my talks and that is highlighted in the namespace documentation. This is why basic arithmetic operations such as +,-,etc are overridden.
As to your question - yes - we can bump the clojure version compat to 1.11 - but we have to solve this problem first and I believe the best way to solve it is with a macro that checks the current clojure version and does further exclusions if the version is 11 or greater.
Aha! That makes a lot of sense. I rarely delve into this namespace but instead use the basic fns over in tech.ml and not having checked in detail assumed it was a pre-1.11-library fix --- my bad.
A macro seems appropriate.
Fixed in latest release
As of clojure 1.11.0 there are built-in functions for abs, infinite? random--uid, parse-uuid in clojure.core. This means that we're doing an (seemingly) unnecessary replacement of builtins!
Can we bump clojure version compat to 1.11.x?