➕ Added a new clojure.math namespace which provides wrappers for the functions available in java.lang.Math. 👍 These functions are narrowed to only
doubleoverloads and provide primitive support without reflection.
In addition, the following functions were added to clojure.core:
abs- absolute value in optimized form for all Clojure numeric types (long, double, ratio, bigint, bigdecimal)
NaN?- predicate for doubles to check whether "not a number"
infinite?- predicate for doubles to check whether positive or negative infinity
CLJ-2668 Add NaN? and infinite? predicates
CLJ-2664 Add clojure.java.math namespace, wrappers for java.lang.Math
⚡️ CLJ-2673 Add
abs, and update
maxto use Math impls when possible
📄 CLJ-2677 clojure.math - fix method reflection in bodies and inlines, fix docstrings, renamed
✅ CLJ-2689 Fix clojure.math tests to be more tolerant of floating point comparisons
Clojure APIs that pass work off to other threads (e.g. send, send-off, pmap, future) now convey the dynamic bindings of the calling thread:
(def ^:dynamic *num* 1) (binding [*num* 2] (future (println *num*))) ;; prints "2", not "1"
You can hint different arities separately:
(defn hinted (^String ) (^Integer [a]) (^java.util.List [a & args]))
🚀 This is preferred over hinting the function name. Hinting the function name is still allowed for backward compatibility, but will likely be deprecated in a future release.
(= (comp) identity) => true
📄 A def can now have a docstring between name and value.
(def foo "a foo" :foo)
It's a best practice to name the threads in an executor thread pool with a custom ThreadFactory so that the purpose of these threads is clear in thread dumps and other runtime operational tools.
Patch causes thread names like:
clojure-agent-send-pool-%d (should be fixed # of threads) clojure-agent-send-off-pool-%d (will be added and removed over time)
This patch allows clojure.main to accept an argument pointing to a namespace to look for a -main function in. This allows users to write -main functions that will work the same whether the code is AOT-compiled for use in an executable jar or just run from source.
Promoting this library eliminates the need for a dependency on old contrib.
This adds InputStream, Reader, File, byte to the list of inputs for clojure.java.shell/sh
➕ Adds special form docs to the REPL