On Saturday, 15 December 2012 18:09:13 UTC+10, Peter West wrote: > > > > On Saturday, 15 December 2012 17:42:05 UTC+10, puzzler wrote: >> >> (I took the liberty of replacing #(= \a %) with #{\a}) >> >> On Fri, Dec 14, 2012 at 11:37 PM, Mark Engelberg <mark.en...@gmail.com>wrote: >> >>> (comp (partial apply str) (partial filter #{\a})) >>> >> >> > You're most welcome. Thank you for this. > > A couple of questions, if I may. > > In (partial apply str) why the apply? > > Given the apply, why the partial? > > About the 'apply', apply takes at least [f args], but (apply str) has only [f]. 'partial' establishes a context in which some args are assumed to be missing, and are assumed to be applied when the partial function is applied. Is this correct?
'comp' doesn't work in the place of 'partial'. So (comp apply str) doesn't work for (at least) the same reason that (apply str) doesn't work. 'str' returns a single value, which means that the arg list to be presented to apply consists of only a single value, instead of [f args]. Is this correct? -- 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