I understand your point and there are several competing comparisons here. Generally only collection functions take the coll first. eduction is similar to sequence (and into and reduce and transduce) in taking it last (but differs in taking multiple xforms). The multiple xforms are similar to ->> though which works left to right and puts the source first. I think I'd rather emphasize it's similarity to sequence than its similarity to ->>.
On Friday, April 3, 2015 at 10:08:38 AM UTC-5, miner wrote: > > > > On Apr 1, 2015, at 11:16 AM, Alex Miller <al...@puredanger.com > <javascript:>> wrote: > > > > - eduction now takes multiple transformations, not just one, and > composes them. This is designed for mechanical rewriting (hello tool > developers!!) of ->> chains like this: > > > > (->> s (interpose 5) (partition-all 2)) > > > > to this: > > > > (->> s (eduction (interpose 5) (partition-all 2))) > > > > Maybe it’s just me, but the eduction argument order just looks strange to > me. For a variadic function, I would have expected the single collection > to come first, then any number of xforms. There must be a better reason > than mechanical rewriting. Wouldn't a macro make more sense? > > (defmacro educe->> [coll & xfs] `(->Eduction (comp ~@xfs) ~coll)) > > So the rewrite could be just educe->> for ->>, without having to wrap the > xforms at all. > > (educe->> s (interpose 5) (partition-all 2)) > > > > Steve Miner > steve...@gmail.com <javascript:> > > > > > > > -- 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/d/optout.