If you want to clear the current namespace of all temporary variables and functions that you specified, you can use this one liner (or execute its function):
(map #(ns-unmap *ns* %) (keys (ns-interns *ns*)))
or
(ns myutil) (defn ns-clean "Remove all internal mappings from a given name space or the current one if no parameter given." ([] (ns-clean *ns*)) ([ns] (map #(ns-unmap ns %) (keys (ns-interns ns))))) (ns mytest) ... make loads of junk ... (myutil/ns-clean) ... great!!! I can now make all new junk ...
It does not pretend to give you a squeaky clean namespace, only one with less junk that typically accumulates in a typical replication session.
Use with caution: do not pull the mat from under your feet!
Peter Tillemans Sep 03 '10 at 17:42 2010-09-03 17:42
source share