I have a macro that looks at the form that is passed in and uses some of the symbol names from the passed code. It works, but if I use cloverage it stops working. It seems that cloverage wraps forms with its own stuff, but if I print the passed form in defmacro I don’t see anything suspicious. So when I add :
(println "FORMS" forms)
in the printout I see:
Instrumented web.util.request
FORMS (user-id email (or domain -))
But then the macro generates code that implies that that symbols are moved around somehow. The macro looks for first symbol that is not in a list in first position, so in this case the symbol domain should be selected, instead I get or. The thing works as expected if I don’t run it in cloverageWhat's the macro def?
Have you tried prn instead of println?
can’t divulge the code, but I diagnosed the problem
macro was using list? to detect function call forms
cloverage changes lists to cons
Not the first time I’ve been burned by the fact that cons is somehow not a list. What’s the best way to detect if it is either
don't ever use list? (for this reason)
so in macros I should use seq? to detect function calls?
yes
ok thanks