Alice <dofflt...@gmail.com> writes: > I've used those as a debugging tool, and never thought about using it > inside a macro.
For almost all macros you'll probably ever define, you don't need to drive macro expansion yourself. You need it only if you have to transform code that might be anywhere inside the macro's arguments, possibly only created by nested macro calls, like !> and !< in case of `go`. I had a similar (but simpler) scenario once, where I had some macro defining a rule in terms of a pattern and an action. Such a rule could be applied like a function, but it could also be applied as a test where it wouldn't perform its action but just return a thunk encapsulating the action. But that encapsulation with a thunk cannot work if the action uses `recur` to call the rule function recursively. So in that case, my macro had to replace recurs with normal recursive calls in the "execute as test" case. Bye, Tassilo > On Monday, August 5, 2013 8:52:56 PM UTC+9, Tassilo Horn wrote: >> >> Alice <doff...@gmail.com <javascript:>> writes: >> >> > I didn't know that macros can do that! >> >> Then you might want to have a look at `macroexpand-1` and `macroexpand` >> from clojure.core and `mexpand-1`, `mexpand`, and `mexpand-all` from >> clojure.tools.macro. >> >> Bye, >> Tassilo >> > > -- -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.