clojure.core/->¶
Threads the expr through the forms. Inserts x as the second 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 second item in second form, etc.
Examples¶
Note by steveminer¶
See also ->> which is similar but threads the first expr as the last argument of the forms.
Note by John Wang¶
I have a short blog on this, in case you are still confused on it and understand Chinese.
Note by phreed¶
Can be used as an alternative to get-in.
See also¶
- clojure.core/->> (7)
- clojure.core/as-> (4)
- clojure.core/get-in (5)
- clojure.core/some-> (0)
- clojure.core/doto (0)
- clojure.core/.. (3)
Content from the matching ClojureDocs page, with authors credited on each contribution.