Re: why expressions in macro are not evaluated?

2011-09-17 Thread jingguo
Michael, thanks for your explanation. I have used dorun to solve my problem following your suggestion. -- 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 m

Re: why expressions in macro are not evaluated?

2011-09-14 Thread Michael Gardner
On Sep 13, 2011, at 2:39 AM, jingguo wrote: > I get a_message printed twice if I paste the code in a clojure REPL. > But I save the code into a file called foo.clj and use "clj foo.clj" > to run it. I get nothing in stdout. It seems that (printf "a_message > \n") > is not evaluated. Can anybody ex

why expressions in macro are not evaluated?

2011-09-14 Thread jingguo
I write a simple macro and an invocation of the macro. Here is the code: (defmacro my-macro [& body] `(for [cur-date# ["2011-09-04" "2011-09-05"]] (do ~@body) ) ) (my-macro (printf "a_message\n") ) I get a_message printed twice if I paste the code in a clojure REPL. But I save the co