On Wed, Jan 12, 2011 at 8:04 PM, Alex Baranosky
wrote:
> -> and ->> do the same things, except -> threads through the first argument
> of the functions, and ->> threads through the second argument.
->> threads through the last argument.
Both macros are useful for unnesting complex expressions. T
Oops. Sorry, I'm clearly too tired to post. Thsoe examples aren't quite
right.
Those are the threading macros.
(-> one two three) expands to (three (two one))
-> and ->> do the same things, except -> threads through the first argument
of the functions, and ->> threads through the second argum
-> and --> are macros in clojure.core, both
(-> one #(two % "a") three)
(->> one #(two "a" %) three)
expands to
(three #(two one "a"))
and (->> one #(two %1 %2) three)
expands to
(three #(two "a" one))
On Wed, Jan 12, 2011 at 10:40 PM, Sean Allen wrote:
> So i've used this because I picked
So i've used this because I picked it up from numerous tutorials but I've
never really understood it,
can I get a some decent background information on ->> and ->?
I picked them up from compojure tutorials and don't feel anywhere near
comfortable enough w/
what is actually going on.
Thanks.
-Sea