3.2 Entering and exiting the Debugger

3.2.3 Recursive Debugger levels

If an error is signaled while you are evaluating forms within the Debugger, the Debugger is called again on the new error, and you enter a second Debugger level. If a new error is signaled at the second level, you enter a third Debugger level, and so on. At each level, you can examine the most recently interrupted evaluation, as well as previous evaluations. You can exit a recursive level by selecting the appropriate option.

For example, if you create a global variable but use it before its value is assigned, you enter the Debugger:

> (defvar *favorite-ice-cream*)
*FAVORITE-ICE-CREAM*

> *favorite-ice-cream* >>Error: The symbol *FAVORITE-ICE-CREAM* has no global value. SYMBOL-VALUE: Required arg 0 (S): *FAVORITE-ICE-CREAM* :C 0: Try evaluating *FAVORITE-ICE-CREAM* again :A 1: Abort to Lisp Top Level ->

If you attempt to set the value of*favorite-ice-cream* to an unbound symbol, a new error is signaled and you enter a second Debugger level:

-> (setq *favorite-ice-cream* chocolate)
>>Error: The symbol CHOCOLATE has no global value.
SYMBOL-VALUE:
   Required arg 0 (S): CHOCOLATE
:C  0: Try evaluating CHOCOLATE again
:A  1: Abort to Debugger Level 1
    2: Try evaluating *FAVORITE-ICE-CREAM* again
    3: Abort to Lisp Top Level
->-> 

The Debugger displays a new error message and a new list of options; note that the prompt now consists of two arrows (->->), indicating that you have entered a second Debugger level.

You can enter a third Debugger level by typing another invalid expression:

->-> (setq *favorite-ice-cream* vanilla)
>>Error: The symbol VANILLA has no global value.
SYMBOL-VALUE:
   Required arg 0 (S): VANILLA
:C  0: Try evaluating VANILLA again
:A  1: Abort to Debugger Level 2
    2: Try evaluating CHOCOLATE again
    3: Abort to Debugger Level 1
    4: Try evaluating *FAVORITE-ICE-CREAM* again
    5: Abort to Lisp Top Level
->->-> 

The Debugger prompt now consists of three arrows to indicate a third Debugger level. You can return to a previous Debugger level and retry a previous evaluation by entering the option number at the Debugger prompt. You can also simply abort the current evaluation and return to the Lisp top level by selecting option5 or by entering the command:a:t.

The following example exits the Debugger by assigning a valid value to the variable*favorite-ice-cream* and then evaluating the variable again:

->->-> (setq *favorite-ice-cream* 'chocolate)
CHOCOLATE
->->-> 4
Try evaluating *FAVORITE-ICE-CREAM* again
CHOCOLATE

> *favorite-ice-cream* CHOCOLATE >

Note that at the top level, the variable*favorite-ice-cream* is now globally bound.


The User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker