clojure.core/->>¶
Threads the expr through the forms. Inserts x as the last item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the last item in second form, etc.
Examples¶
Note by Jacolyte¶
I'm getting: Exception in thread "main" java.lang.Exception: Unable to resolve symbol: ->> in this context (11.clj:25)
It's also extremely hard to Google this method. It'd be nice if there was a non-symbol name for this that one could search for.
Update
The name of this operator is called a thrush.
Note by steveminer¶
See also -> which is similar but threads the first expr as the second argument of the forms.
Note by Jacolyte¶
My error was due to using an old version of Clojure. I was using 1.0.0.
Note by nmichel¶
There is something I don't get : in the case "form" is a seq, why should we write ... (with-meta `(~(first form) ~@(next form) ~x) (meta form))
and not ... (with-meta `(~@form ~x) (meta form))
as items order in "form" is not changed ?
Note by nzl-nott¶
"See also -> which is similar but threads the first expr as the second argument of the forms."
This is incorrect, it is not the second ARGUMENT, but the second ITEM.
See also¶
- clojure.core/-> (4)
- clojure.core/some->>
- clojure.core/comp (15)
- clojure.core/cond->>
- clojure.core/cond-> (4)
- clojure.core/as-> (4)
Content from the matching ClojureDocs page, with authors credited on each contribution.