Hi

If I apply the following function to 4 and 6

(defn arith [x y]
  (map (fn [op] [(op x y) `(~op ~x ~y)]) [+ - / *]))

I'd like to get a result of the form

([10 (+ 4 6)] [-2 (- 4 6)] ...)

but instead I get something like
([10 (#<core$_PLUS_ clojure.core$_PLUS_@4f6de641> 4 6)] ...

How do I output the var as written (I'd also be happy with clojure.core/+)?

As an aside, when playing around with quoting and unquoting, I noticed
that the result of  ('+ 3 5) is 5. I'm not sure what I would have
expected (maybe an error?) but it wasn't the third item of the list.
Is there any reason for this?

Many thanks

Paul

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