#clojure tip, use letfn with threading macros for clarity, so instead of doing
(-> 5 (#(* 2 %)) (#(+ 5 %)) (#(/ % 7)))
you could write:
(letfn [(foo [x] (* 2 x))
(bar [x] (+ 5 x))
(baz [x] (/ x 7))]
(-> 5 foo bar baz))
-
-
Yeah it depends, I do find that anonymous functions look really ugly in threading macros though :-) this is a nice compromise I find
-
Agree. In -> I tend to use ->> if I need to shuffle arguments around.
-
yeah I use that trick as well
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.