22 March 2022
Alex Miller
Clojure 1.11 offers new syntax for key phrase argument invocation, namespace aliasing without loading, a brand new clojure.math namespace, and a number of additional bug fixes and enhancements.
Keyword arguments are optionally on the market trailing variadic arguments of the ranking (f akey aval bkey bval …). Invoking functions with key phrase arguments is convenient for folks to write, nonetheless key phrase args will not be collections so they’re bright to waft between functions. In Clojure 1.11, functions taking key phrase arguments can now be passed a trailing blueprint somewhat than or as well to and following the main/mark pairs. When a lone blueprint is passed, it is ancient for destructuring, else the trailing blueprint is added to the main/mark pair blueprint by conj. This switch makes key phrase arg functions extra convenient for programmatic use.
Spec (and other libs) rely on tremendous keywords as spec names. Namespace aliasing in ns
makes long names shorter nonetheless required namespaces to exist and be loaded. In Clojure 1.11, require
adds a brand new option :as-alias
, which is like :as
nonetheless would not require the namespace to exist or load.
The JDK kit java.lang.Math offers gain entry to to many precious math functions. Clojure beforehand relied on the utilization of these thru interop, nonetheless this had factors with discoverability, well-liked performance, higher account for software program, and portability. The new clojure.math namespace offers wrapper functions for the methods readily on the market in java.lang.Math for long
and double
overloads with instant well-liked invocation.
Detailed changelog
Explore the switch log for an total checklist of all changes in Clojure 1.11.0.