On Tuesday, March 12, 2013 6:20:56 PM UTC+1, Sean Corfield wrote:

>
> > (as-> response x (:body x) (:postalCodes x) (map to-location x) (sort-by 
> > :city x)) 
>
> I like the new threading operators and I'm looking forward to using 
> them but I'm not sure this is better since you need some neutral 
> identifier that, in this expression, represents a map, a map, an array 
> and a sequence so the choice is either picking a good name for all of 
> those or something generic (most likely a punctuation symbol)... 
>

The best approach (for me) is always using the same symbol as a template 
placeholder, I like to think of it as "x marks the spot". Yes, it does 
require a new mind-crutch, specific to just that form, but I came to like 
it almost instantaneously---especially if you need to use x in more than 
one place within a threading step. If Clojure started out with just as->, 
it may have never occurred to anybody to ask for -> and ->>.

-Marko

-- 
-- 
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