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".
:s Step this form and all of its subforms (optional +ve integer arg)
:st Step this form without stepping its subforms
:si Step this form without stepping its arguments if it is a function call
:su Step up out of this form without stepping its subforms
:sr Return a value to use for this form
:sq Quit from the current stepper level
:redo &optional <command identifier>
Redo a previous command, identified by its number or a substring.
:get <variable> <command identifier>
Get a command from the history list and put it in a variable.
:help Produce this list.
:use <new form> <form to replace> &optional <command identifier>
Replace one form with another form in a previous command and redo the command.
:his List the command history.
If you've used the MCL stepper.
:s Step Button :st Step Over Button :su Go Button ( kind of ) :sq Quit Button
( if t (1+ 2 ) (1+ 3) ) but that isn't very interesting.
The following function is slightly more interesting.
(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:
CL-USER 6 > (step (step-me 3 5 0 ))
If you type ':s' this will start the incremental evaluate of the function. Continuing to type ':s' will cause the next subexpression to be evaluated. When you get to the form
(= NUM-TIMES 0 ) ->type ':st' 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 ':st' 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".
CL-USER 79 > (step (step-me 3 5 0 )) (STEP-ME 3 5 0) -> :s 3 -> :s 3 5 -> :s 5 0 -> :s 0 (COND ((= NUM-TIMES 0) RESULT) ((= NUM-TIMES 1) RESULT) (T (STEP-ME INT (1- NUM-TIMES) (+ INT RESULT)))) <=> (IF (= NUM-TIMES 0) (PROGN RESULT) (IF (= NUM-TIMES 1) (PROGN RESULT) (PROGN (STEP-ME INT (1- NUM-TIMES) (+ INT RESULT))))) (IF (= NUM-TIMES 0) (PROGN RESULT) (IF (= NUM-TIMES 1) (PROGN RESULT) (PROGN (STEP-ME INT (1- NUM-TIMES) (+ INT RESULT))))) -> result 0 (IF (= NUM-TIMES 0) (PROGN RESULT) (IF (= NUM-TIMES 1) (PROGN RESULT) (PROGN (STEP-ME INT (1- NUM-TIMES) (+ INT RESULT))))) -> (+ result 1 ) 1 (IF (= NUM-TIMES 0) (PROGN RESULT) (IF (= NUM-TIMES 1) (PROGN RESULT) (PROGN (STEP-ME INT (1- NUM-TIMES) (+ INT RESULT))))) -> :sq :QUITNot 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. :-)