Skip to content

Commit 8ae9e4f

Browse files
committed
CLJ-1385 transient docstring should include usage model from docs
1 parent 3eab1a5 commit 8ae9e4f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/clj/clojure/core.clj

+9-1
Original file line numberDiff line numberDiff line change
@@ -3358,7 +3358,15 @@
33583358

33593359
;;;;;;;;;;;;;;;;;;;;; editable collections ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
33603360
(defn transient
3361-
"Returns a new, transient version of the collection, in constant time."
3361+
"Returns a new, transient version of the collection, in constant time.
3362+
3363+
Transients support a parallel set of 'changing' operations, with similar names
3364+
followed by ! - assoc!, conj! etc. These do the same things as their persistent
3365+
counterparts except the return values are themselves transient.
3366+
3367+
Note in particular that transients are not designed to be bashed in-place. You
3368+
must capture and use the return value in the next call. In this way, they support
3369+
the same code structure as the functional persistent code they replace."
33623370
{:added "1.1"
33633371
:static true}
33643372
[^clojure.lang.IEditableCollection coll]

0 commit comments

Comments
 (0)