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.


That will do the trick, but it's kind of ugly compared to just having a
symbol for the first argument to reduce.


> I think memfn is some relict like .., which pre-dates some
> of the nice additions to clojure.
>
>        #(.foo %1 %2 fixed-arg %3)


What, you mean it predates the #(...) read-macro?

I wouldn't know; I only started using Clojure when version 1.0 became
available.

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