java - Mutable seqs in clojure -


I have a list in the closure, and the list (due to the built-in java library) needs to be modified (delete the iterator Using the method). (MAP FN CEC) is a much better way to stop this effect than writing the destructive equivalent?

Closer lists are invariant so if you need a temporary list, then it is possible to use one such Which provides Java.

For example:

  user = & gt; (Import java.util.LinkedList) java.util.LinkedList user = & gt; (Def a (list 3 6 1 3)) # 'user / one user = & gt; (Def B (java.util.LinkedList.A)) # 'User / B user = & gt; B # & lt; Linkedist [3, 6, 1, 3] & gt; User = & gt; (.remove b 6) Real User = & gt; B # & lt; Linkedist [3, 1, 3] & gt;  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -