After three years, the concurrent programming language Clojure released version 1.11

The concurrent programming language Clojure is a LISP-style language that runs on the JVM. Three and a half years after the release of Clojure 1.10 , version 1.11 of Clojure is released, and Clojure 1.11 provides a new syntax for keyword argument invocation, namespace aliases that do not need to be loaded, a new clojure.math namespace, and many other bug fixes and enhancements Function.

Keyword arguments are optional trailing variable arguments of the form (f akey aval bkey bval ...​) . Calling functions with keyword arguments is convenient to write, but keyword arguments are not sets, so they are difficult to flow between functions. In Clojure 1.11, functions that take keyword arguments can now be passed a trailing map instead of key/value pairs, or after key/value pairs in addition to key/value pairs. When a separate map is passed it is used for destructuring, otherwise the tail map is added to the key/value pair map by conj, this change makes the keyword arg function easier to program.

Spec (and other libraries) rely on qualified keywords as canonical names. Namespace aliases in ns make long names shorter, but require a namespace to exist and load. In Clojure 1.11, a new option was added to require :as-alias, which is similar to :as, but does not require a namespace to exist or be loaded.

The JDK package java.lang.Math provides access to many useful mathematical functions. Clojure previously relied on using these functions through interop, but had issues with discoverability, raw performance, higher-order applications, and portability. The new clojure.math namespace provides wrapper functions for the methods available in java.lang.Math for fast primitive calls longand doubleoverloads .

See the changelog for a complete list of all changes in Clojure 1.11.0 .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324373258&siteId=291194637
Recommended