From 8834a98cff2d8f80458957fccab5424f4b90cde5 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 8 Dec 2017 19:41:59 -0800 Subject: trace: bugfix: spurious "previously traced" warning When a method is traced with (trace (meth class slot)), a spurious warning occurs. This is because the function is recorded in the trace hash first and then the hook is installed, and the hook is installed using the static-slot-ensure function which performs the trace warning check. * share/txr/stdlib/trace.tl (sys:trace): Swap the order: install the hook first, and then put the the previous function into the trace hash. Doing this in parallel with pset would also work. --- share/txr/stdlib/trace.tl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/txr/stdlib/trace.tl b/share/txr/stdlib/trace.tl index 6cc97914..d5ecd103 100644 --- a/share/txr/stdlib/trace.tl +++ b/share/txr/stdlib/trace.tl @@ -51,8 +51,8 @@ val)) (if abandoned (sys:trace-leave lex-n :abandoned))))))) - (set [sys:*trace-hash* n] prev) - (set (symbol-function n) hook))))))) + (set (symbol-function n) hook + [sys:*trace-hash* n] prev))))))) (defun sys:untrace (names) (flet ((disable (name-orig name) -- cgit v1.2.3