1 Deprecated and Removed Features

1.1 Record and Type Fields that Start With a Dash Can No Longer Be Accessed Using Dot Syntax

Clojure 1.4 introduces a field accessor syntax for the dot special form that aligns Clojure field lookup syntax with ClojureScript's.

For example, in Clojure 1.3, one can declare a record with a field starting with dash and access it like this:

(defrecord Bar [-a]) ;=> user.Bar
(.-a (Bar. 10)) ;=> 10

In 1.4, the above code results in IllegalArgumentException No matching field found: a for class user.Bar

However, the field may still be accessed as a keyword:

(:-a (Bar. 10)) ;=> 10

2 New and Improved Features

2.1 Reader Literals

Clojure 1.4 supports reader literals, which are data structures tagged
by a symbol to denote how they will be read.

When Clojure starts, it searches for files named data_readers.clj
at the root of the classpath. Each such file must contain a Clojure
map of symbols, like this:

{foo/bar my.project.foo/bar
foo/baz my.project/baz}

The key in each pair is a tag that will be recognized by
the Clojure reader. The value in the pair is the
fully-qualified name of a Var which will be invoked by the reader to
parse the form following the tag. For example, given the
data_readers.clj file above, the Clojure reader would parse this
form:

#foo/bar [1 2 3]

by invoking the Var #'my.project.foo/bar on the vector [1 2 3]. The
data reader function is invoked on the form AFTER it has been read
as a normal Clojure data structure by the reader.

Reader tags without namespace qualifiers are reserved for Clojure. Default
reader tags are defined in clojure.core/default-data-readers but may be
overridden in data_readers.clj or by rebinding *data-readers*.

2.1.1 Instant Literals

Clojure supports literals for instants in the form
#inst "yyyy-mm-ddThh:mm:ss.fff+hh:mm". These literals are parsed as java.util.Dates
by default. They can be parsed as java.util.Calendars or java.util.Timestamps
by binding *data-readers* to use clojure.instant/read-instant-calendar or
clojure.instant/read-instant-timestamp.

2.1.2 UUID Literals

Clojure supports literals for UUIDs in the form #uuid "uuid-string". These
literals are parsed as java.util.UUIDs.

2.2 clojure.core/mapv

mapv takes a function f and one or more collections and returns a
vector consisting of the result of applying f to the set of first items of
each collection, followed by applying f to the set of second items in each
collection, until any one of the collections is exhausted. Any remaining
items in other collections are ignored. f should accept a number of arguments
equal to the number of collections.

2.5 clojure.core/reduce-kv

reduce-kv reduces an associative collection. It takes a function f,
an initial value init and an associative collection coll. f should
be a function of 3 arguments. Returns the result of applying f to init,
the first key and the first value in coll, then applying f to that result
and the 2nd key and value, etc. If coll contains no entries, returns init
and f is not called. Note that reduce-kv is supported on vectors,
where the keys will be the ordinals.

When the reader finds an invalid character in a Unicode string literal, it
now reports the character instead of its numerical representation.

2.16 clojure.core/hash No Longer Relies on .hashCode

hash no longer directly uses .hashCode() to return the hash of a Clojure
data structure. It calls clojure.lang.Util.hasheq, which has its own implementation
for Integer, Short, Byte, and Clojure collections. This ensures that the hash code
returned is consistent with =.

2.17 Java 7 Documentation

*core-java-api* will now return the URL for the Java 7 Javadoc when you are
running Java 7.

2.18 loadLibrary Loads Library Using System ClassLoader

A static method, loadLibrary, was added to clojure.lang.RT to load a
library using the system ClassLoader instead of Clojure's class loader.