Is this happening on lines: for (reduce conj [A])
[f val coll] gets called eventually from [f coll] and since s does not
exist it ends with val straight.
(def reduce
(fn r
([f coll]
(let [s (seq coll)]
(if s
(r f (first s) (next s))
Thanks everyone, in the apply function source code I see
([^clojure.lang.IFn f args]
(. f (applyTo (seq args
Seems the (applyTo (seq args)) returns arg parameters,
And the f is invoked only once:
(. f args)
--
--
You received this message because you are subscribed to the
Looking at it as
(. f applyTo (seq args))
The object instance of IFn 'f' calls the method 'applyTo' with sequence
'args'.
From http://clojure.org/java_interop
(*.* instance-expr member-symbol)(*.* instance-expr (method-symbol args*))
or(*.* instance-expr method-symbol args*)
That makes
Hi there:
Why does
(apply str [2 3]) work
and not
(apply inc [4 5])
though
(apply inc [4])
does work?
Thanks.
--
--
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