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)
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
On Tue, Aug 4, 2009 at 2:22 AM, Meikel Brandmeyerm...@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)
Out of curiosity, does anyone know what memfn stands for? Is it an
abbreviation? Fn obviously stands for function. Mem calls to mind memoize,
but I'm not sure I see how memfn memoizes anything...
--~--~-~--~~~---~--~~
You received this message because you are
I believe it stands for member function. From the doc string:
Expands into code that creates a fn that expects to be passed an
object and any args and calls the named instance method on the
object passing the args. Use when you want to treat a Java method as
a first-class fn.
On Mon,
Ah, makes sense. Thanks.
On Mon, Aug 3, 2009 at 8:53 AM, Mike DeLaurentis delauren...@gmail.comwrote:
I believe it stands for member function. From the doc string:
Expands into code that creates a fn that expects to be passed an
object and any args and calls the named instance method on
On Mon, Aug 3, 2009 at 8:53 AM, Mike DeLaurentis delauren...@gmail.comwrote:
I believe it stands for member function. From the doc string:
Expands into code that creates a fn that expects to be passed an
object and any args and calls the named instance method on the
object passing the
user= (macroexpand-1 '(memfn add x y))
(clojure.core/fn [target__4193__auto__ x y] (. target__4193__auto__
(add x y)))
That is, basically (fn [object x y] (.add object x y)).
.add is macroexpanded into the more general dot form, as shown in the
memfn expansion.
user= (read-string (.foo
On Mon, Aug 3, 2009 at 3:45 PM, Richard Newman holyg...@gmail.com wrote:
user= (macroexpand-1 '(memfn add x y))
(clojure.core/fn [target__4193__auto__ x y] (. target__4193__auto__
(add x y)))
That is, basically (fn [object x y] (.add object x y)).
.add is macroexpanded into the more