[TTRACE-4] trace-ns traces all vars in the ns, not just fns Created: 12/Sep/13 Updated: 15/May/14 Resolved: 14/Mar/14
|Reporter:||Chris Jeris||Assignee:||Luc Préfontaine|
Clojure 1.5.1, tools.trace 0.7.6
|Patch:||Code and Test|
trace-ns traces every var in the given namespace, fns and non-fns alike. This is counterintuitive from the docstring (which says "trace all fns in the given name space") – when I have a data object like a map in a var, it may happen to implement IFn, but if I trace it I can't assoc onto it any more.
I assume it's useful to retain the ability to trace IFn's that aren't fns at the level of trace-var. The attached patch instead changes trace-ns to check that traced values are fn? (not just ifn?) before wrapping them. Andy Fingerhut suggests that, if the ability to trace IFn's that aren't fns is not actually all that useful, it's simpler just to change ifn? to fn? in trace-var*.
|Comment by Luc Préfontaine [ 14/Mar/14 5:19 PM ]|
|Comment by Luc Préfontaine [ 14/Mar/14 5:51 PM ]|
Fix accepted. Only fns are traced.
|Comment by Luc Préfontaine [ 15/Mar/14 3:52 PM ]|
Official release 0.7.8, bad readme in 0.7.7