Re: Clojure macros

2010-09-05 Thread ingokr
Ah! Thanks a lot, MichaƂ -- that clarifies a lot for me. Best regards, Ingolf -- 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 pat

Re: Clojure macros

2010-09-05 Thread ingokr
Hi again -- First, let me thank all of you for you kind and instructive comments. Kent: thanks for the explanation of the relationships between reader and macro expansion. Patrick & Meikel: thanks! Your solutions do produce almost what I need; the idea is with (tm a b) I should get back {:a a

Clojure macros

2010-09-05 Thread ingokr
Hello -- I am trying to gain a better understanding of Clojure's macro language. The output I am aiming for (and which is to be used as code in another macro) is as follows: {:a a :b b :c c :d d} The attempt I made is as follows: (defmacro tm [& args] `{~@(mapcat (fn [x] (list (keyword x) x)