Alpha - subject to change.
Returns a new, persistent version of the transient collection, in
constant time. The transient collection cannot be used after this
call, any such use will throw an exception.
user> (def foo (transient [1 2 3])) #'user/foo user> foo #<TransientVector clojure.lang.PersistentVector$TransientVector@12c9b4d1> user> (persistent! foo) [1 2 3] user> foo #<TransientVector clojure.lang.PersistentVector$TransientVector@12c9b4d1> user> (conj! foo 4) → ERROR:Transient used after persistent! call user> (persistent! foo) → ERROR: Transient used after persistent! call
(defn persistent!
"Alpha - subject to change.
Returns a new, persistent version of the transient collection, in
constant time. The transient collection cannot be used after this
call, any such use will throw an exception."
{:added "1.1"
:static true}
[^clojure.lang.ITransientCollection coll]
(.persistent coll))
Comments top
No comments for persistent!. Log in to add a comment.