On Tue, Aug 4, 2009 at 2:22 AM, Meikel Brandmeyer<m...@kotka.de> wrote:
>
> Hi,
>
> On Aug 3, 10:10 pm, John Harrop <jharrop...@gmail.com> wrote:
>
>> (defn and-ns
>>   "A non-short-circuiting \"and\" usable in reduce etc."
>>   ([] true)
>>   ([a] a)
>>   ([a b] (and a b))
>>   ([a b & more] (reduce and-ns (and a b) more)))
>
> Don't think to complicated.
>
>        (reduce #(and %1 %2) coll)
>
> This should do the trick, no? It's still non-short-circuiting, though.
>
> I think memfn is some relict like .., which pre-dates some
> of the nice additions to clojure.
>
>        #(.foo %1 %2 fixed-arg %3)
>
> That should fill all the needs, which might come up. (Besides
> an unknown method name, but for that you'll need reflection,
> AFAIK...)
>

Yes, memfn preceded #(),  the latter now being preferred.

Rich

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