Skip to content

Detect references inside of vars created by defmacro #44

Closed
wants to merge 1 commit into from

1 participant

@guns
Collaborator
guns commented Jun 6, 2013

"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 guns Detect references inside of vars created by defmacro
"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
2888896
@guns
Collaborator
guns commented Jun 6, 2013

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.

@guns guns closed this Jun 6, 2013
@guns guns deleted the guns:find-references-in-macro-vars branch Nov 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.