3 ms·
Just like Clojure's threading operator. (-> x (f) (g) (h)) https://clojure.org/guides/threading_macros https://clojure.org/guides/threading_m
by matheusmoreira 3y ago
Just like Clojure's threading operator.
(-> x
(f)
(g)
(h))
https://clojure.org/guides/threading_macros https://clojure.org/guides/threading_macros
- snorremd 3y agoFor those that don't know. In Clojure it is also perfectly valid to drop the parantheses for each subsequent call in a threading macro if you don't want to pass in any additional arguments: (-> x f g h) If you need to pass an additional argument to g you can always do: (-> x f (g foo) h) There are thread first ->, thread last ->>, and even a thread as "as->" depending on where you want to place the argument when you pipe the result through the thread of functions.