On Monday, April 27, 2015 at 12:34:14 PM UTC-4, Vebjorn Ljosa wrote: > > In one of my tests, I was trying to mock something > (`clojure.tools.logging/warn`) that happened to be a macro. It had me > puzzled for a while until I discovered that `with-redefs` resets the value > of the vars after the body is executed, but does not reset the flag that > says that the var is a macro: >
Granted, using `with-redefs` with a macro rarely makes sense because macroexpansion has to occur within the extent of `with-redefs` for the redefinition to have any effect. (I can't even think of an example where I would want to do that, so maybe `with-redefs` should emit a warning when it's being asked to redefine a macro.) But in any case, an attempt to use `with-redefs` on something that happens to be a macro should not mess up the root binding permanently. -- 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/d/optout.