STEP is not supported in CCL.
Solution for TRACE:
When a FOO function with a global name is defined using DEFUN, the compiler is allowed to assume that the function references to this function name refer to the function being defined (unless they are lexically shaded); it can thus skip the implicit SYMBOL-FUNCTION ("call everything that is in the FOO function cell") during self-service (calling FOO from FOO.) This saves one or two instructions for these calls, but (since then, TRACE has been working by changing what SYMBOL-FUNCTION returns) that cannot be tracked.
However, the compiler cannot do this (it cannot even assume that something defined by DEFUN will not be redefined later) if the function name is declared NOTINLINE at the self-starting point:
Example:
? (defun fact (x acc) (declare (notinline fact)) (if (= x 0) acc (fact (- x 1) (* x acc)))) ? (trace fact) NIL ? (fact 3 1) 0> Calling (FACT 3 1) 1> Calling (FACT 2 3) 2> Calling (FACT 1 6) 3> Calling (FACT 0 6) <3 FACT returned 6 <2 FACT returned 6 <1 FACT returned 6 <0 FACT returned 6 ? (step (fact 3 1)) 0> Calling (FACT 3 1) 1> Calling (FACT 2 3) 2> Calling (FACT 1 6) 3> Calling (FACT 0 6) <3 FACT returned 6 <2 FACT returned 6 <1 FACT returned 6 <0 FACT returned 6
To tell the compiler, "as a matter of politics, I would prefer the ability to track functions that are called themselves and are defined using DEFUN and do not care about saving several loops for self-determination, a call."
from: DebugWithOpenMCL
or Rate the following form:
(DECLAIM (OPTIMIZE (DEBUG 3)))
before defining any function that needs to be traced.
source share