In Clojure REPL, this expression
( #(for [x %] (+ 100 (second x))) ['(+ 38) '(+ 48)] )
produces (138,148) as expected
but this one
( #(for [x %] ((first x) 100 (second x))) ['(+ 38) '(+ 48)] )
produces (38 48), which seems really strange.
Both expressions really should give the same result! What am I missing? Any ideas for resolving this mystery will fall in love.
By the way, I tried to use "apply (first x)" and pack the rest of the arguments into a list, but that doesn't seem to matter. The same unexpected result is returned.
Also, to make sure "+" is really allowed by input, I gave REPL
following:
(
which produced
(#'clojure.core/+ #'clojure.core/+) as expected.
source share