On Fri, Mar 4, 2011 at 12:53 PM, Stuart Halloway
<stuart.hallo...@gmail.com> wrote:
> In the context of chaining operators such as ->>, it is logical to consider
> both the input and output of the function. The functions listed under the
> "Seq In, Seq Out" section at http://clojure.org/sequences should all take
> their seq arg last.

The conj function is listed in the "seq in, seq out" section of the
cheat-sheet and doesn't. ;)

But it seems to be the only one there, and cons can be used with ->> instead.

> There is a ticket in JIRA for making -> and ->> more flexible, but I
> couldn't trivially find it because you can't search for punctuation. Feel
> free to respond with a link...

I hate broken search tools that made unwarranted assumptions about
what people would put in, or would search for.

Some code was posted here recently for more flexible -> like macros. I
posted one such. Most of them would thread through a placeholder, e.g.
(-%> 3 (- 1 %) (/ % 2)) threading through %s or (--> [x 3] (- 1 x) (/
x 2)) actually specifying a symbol to thread through and the initial
value in a binding-like syntax. (Both of those examples have -1 as the
desired output.)

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

Reply via email to