Skip to content

clojure.core/transient

View this page on ClojureDocs

Type: function Added: Clojure 1.1 Examples: 4 Runnable: 2
([coll])

Returns a new, transient version of the collection, in constant time.

Transients support a parallel set of 'changing' operations, with similar names followed by ! - assoc!, conj! etc. These do the same things as their persistent counterparts except the return values are themselves transient.

Note in particular that transients are not designed to be bashed in-place. You must capture and use the return value in the next call. In this way, they support the same code structure as the functional persistent code they replace.

Examples

by gstamp on
by yasuto on . May have evaluation errors.
by sanel on . May have evaluation errors.
by claj on

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.