diff options
Diffstat (limited to 'share/txr/stdlib/trace.tl')
-rw-r--r-- | share/txr/stdlib/trace.tl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/share/txr/stdlib/trace.tl b/share/txr/stdlib/trace.tl index a184dbc8..940425c2 100644 --- a/share/txr/stdlib/trace.tl +++ b/share/txr/stdlib/trace.tl @@ -67,6 +67,21 @@ (dohash (n v sys:*trace-hash*) (disable n n))))) +(defun sys:trace-redefine-check (orig-name) + (let ((name (sys:trace-canonicalize-name orig-name))) + (when [sys:*trace-hash* name] + (catch + (cond + ((neq name orig-name) + (throwf 'warning "~!~s won't be traced, though it overrides\n\ + ~s which is currently traced" + name orig-name)) + (t (throwf 'warning "previously traced ~s is redefined and no\ \ + longer traced" + name) + (sys:untrace (list name)))) + (continue ()))))) + (defmacro trace (. names) ^(sys:trace ',names)) |