I find the threading macros expressions much easier to *write* and *edit*
than their nested expression counterparts.

And it comes very handy when working at the REPL, to incrementally build an
expression.

It's easier to toggle on / off some parts of the pipeline than it is for a
nested expression:

(a (b (c (d (e X)))))


oops `d` *may* be wrong, let's try to turn it off:

mmm ... will require a lot of keyboard clicks and paredit magic

On the other hand:

(-> X
    e
    d
    c
    b
    a)


Turning off `d`:

(-> X
    e
    #_d
    c
    b
    a)


or even `d` and `b`:

(-> X
    e
    #_d
    c
    #_b
    a)


piece of cake.

Same goes on for inserting a new expression in a pipeline, pprinting, ...



On Mon, Mar 11, 2013 at 11:58 AM, <edw...@kenworthy.info> wrote:

> So I understand that:
>
> (-> foo bar wibble)
>
> is equivalent to
>
> (wibble (bar (foo)))
>
> With the advantage that the latter version is better, in the sense that
> it's clearer what the final result is (the result of the call to wobble).
>
> What I don't understand is the need for -> the only thing it seems to do
> is make something Lispy appear to be imperative.
>
> Is that it?
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to