technomancy / slamhound

Slamhound rips your namespace form apart and reconstructs it.
Other
473 stars 38 forks source link

Detect references inside of vars created by defmacro #44

Closed guns closed 11 years ago

guns commented 11 years ago

"Slamhound will only find references to vars in a namespace that are consumed within the namespace itself."

A simple solution to this problem is to consume the macro from within the namespace!

If we append (defn) forms that simply call the macro with all declared arglists (quoted to protect against evaluation), slamhound's exception-based approach to ns reconstruction still works for forms declared within defmacro.

Addresses issue #19

NOTE:

This branch conflicts with the improved-require-as-matching branch
in the regrow_test file. The conflict is simple to resolve, but I
can merge these two branches (or all the pull request branches) and
present them as one if you like.
guns commented 11 years ago

I pulled the trigger a little too early on this one, sorry. There are some cases where pre-processing of the macro arguments fail, but I think there may be a clever solution. I will re-open this pull request when I find a solution.

lasiltan commented 6 years ago

Nearly 5 years later, slamhound still doesn't recognize references to imports in macros...