3 ms·
You can also use what is called a transient in Clojure, where you can get an mutable copy, do what you need to do, then return a immutable copy back. The bigge
by bebop 8y ago
You can also use what is called a transient in Clojure, where you can get an mutable copy, do what you need to do, then return a immutable copy back.
The biggest benefit seems to be when adding elements within a for loop. The example on this page illustrates how you could use this. https://clojure.org/reference/transients#_example https://clojure.org/reference/transients#_example