I wonder in which cases this code is a good choice: a function that
returns uneval'ed code. Something about macros not being an option
where a function is expected, or a kind of lazy eval? Will this be any
better or worse: (defn m [f s] (fn [] (map f s))) then doing (foo)
instead of (eval foo)?

On Apr 14, 6:46 am, David McNeil <mcneil.da...@gmail.com> wrote:
> I am puzzled by the results below. Can anyone explain the difference
> in behavior?
>
> -David
>
> ----
>
> (defn mapper [f stream]
>   `(map ~f ~stream))
>
> (eval (mapper #(+ 1 %) [10 11 12]))
> ;; -> (11 12 13)
>
> (eval (mapper (partial + 1) [10 11 12]))
> ;; -> No matching ctor found for class clojure.core$partial...

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