If I have a namespace symbol e.g. 'clojure.core
or a path to a clojure source file how can I get all symbols that are new to the namespace, i.e. not :refer
-ed or interned in another namespace?
Those symbols would come from top level def
s (and defn
s) but also inside let
bindings and such. My goal is to analyze a namespace and walk the tree effectively doing a find-replace on certain symbols based on a predicate.
Edit: I'm not just looking for top level vars, I'm looking for any symbol. If there's a function with a let binding in it I'm looking for symbol that was bound.
dir
in that answer does what you want, it appears. – Mars