Tutorial by Examples

This macro gives the output of a given line as the last argument of the next line function call. For e.g. (prn (str (+ 2 3))) is same as (->> 2 (+ 3) (str) (prn))
This macro gives the output of a given line as the first argument of the next line function call. For e.g. (rename-keys (assoc {:a 1} :b 1) {:b :new-b})) Can't understand anything, right? Lets try again, with -> (-> {:a 1} (assoc :b 1) ;;(assoc map key val) (rena...
This is a more flexible alternative to thread first or thread last. It can be inserted anywhere in the list of parameters of the function. (as-> [1 2] x (map #(+ 1 %) x) (if (> (count x) 2) "Large" "Small"))

Page 1 of 1