Once you fall into the stepper the prompt changes to ' S-exp ->'. Where S-exp is the s-expression you are about to step.
Stepper Commands.
The stepper commands are the following. Note that the colon is part of the
command "name".
:n Evaluate current expression in step mode.
:s Evaluate current expression without stepping.
:u Evaluate current expression without stepping
and go up one level of stepping.
:x Finish evaluation, but turn Stepper off.
:p Print current expression.
:pp Pretty-print current expression.
:b Enter the Debugger.
:q Exit to Top Level.
:h or ? Print this text.
If you've used the MCL stepper.
:n Step Button :s Step Over Button :x Go Button ( kind of ) :q Quit Button
(defun step-me ( int num-times result )
(cond ((= num-times 0 ) result )
((= num-times 1 ) result )
(t (step-me int (1- num-times ) (+ int result )))))
Enter and evaluate this function. Next evaluate the following:
> (step (step-me 3 5 0 ))
If you type ':n' this will start the incremental evaluate of the function. Continuing to type ':n' will cause the next subexpression to be evaluated. When you get to the form
(= NUM-TIMES 0 ) ->type ':s' to "Step Over" this form [ It's compiled anyway so there is nothing particularly interesting to be seen ].
If your code contains a break ( see the debbuger tutorial ), then
you may step or enter ':s' which will likely continue evaluation until
the break is reach or the evaluation is complete, whichever comes first.
Unfortunately, you cannot go back into step mode after continuing
from the break. See the
trace minitutorial
for one way to solve this
"problem".
Once you get tired of stepping through step-me type ':x'
and let the stepper run for the "finish line".
> (step (step-me 3 5 0 ))
(STEP-ME 3 5 0) -> :n
(FUNCTION STEP-ME) -> :n
#
3 = 3
5 = 5
0 = 0
(BLOCK STEP-ME (COND (# RESULT) (# # RESULT) (T #))) -> :p result
(BLOCK STEP-ME (COND ((= NUM-TIMES 0) RESULT) ((= NUM-TIMES 1)
(BREAK "stop the stepper") RESULT) (T (STEP-ME INT (1- NUM-TIMES)
(+ INT RESULT))))) -> 0 -> :p (+ 2 result )
(BLOCK STEP-ME (COND ((= NUM-TIMES 0) RESULT) ((= NUM-TIMES 1)
(BREAK "stop the stepper") RESULT)
(T (STEP-ME INT (1- NUM-TIMES) (+ INT RESULT))))) -> 2 ->
Not exactly pretty but it is functional.
This capability can come in handy when you have stepped into an errant function and you are trying to decide what you should change to code to really do. You can try out evaluating certain S-expressions to confirm to yourself what you should have wrote in the first place.... it happens to all of us. :-)