If an error occurs, the Lisp interpreter will invoke the "break package" with
error message and a different prompt. To simply exit from the error, type
":res" for "resume" and it will abort the run and return to the top-level
prompt. For example:
USER(1): (rest 3) Error: Attempt to take the cdr of 3 which is not listp. [condition type: SIMPLE-ERROR] [1] USER(2): :res USER(3):
If the program is running too long (e.g. caught in an infinite loop)
or if you simply want to terminate execution, type "C-c C-c"
(two control C's in succession) to abort. It may take a while for
Lisp to notice your interupt, so be patient after you type the abort
command and it should eventually terminate.
USER(5): (factorial 100000) ;Comment: typed C-c C-c after a bit.... Error: Received signal number 2 (Keyboard interrupt) [condition type: INTERRUPT-SIGNAL] Restart actions (select using :continue): 0: continue computation [1] USER(6): :res USER(7):
The command ":cl" followed by the name of a file (no quotes, no need to include
the .lisp extension) will compile and load a Lisp file. The command ":ld" will
simply load a file, prefering the compiled version if there is one.
USER(8): :cl factorial ;;; Compiling file factorial.lisp ; Compiling FACTORIAL ; Note: tail merging call to EXCL::*_2OP ;;; Writing fasl file factorial.fasl Warning: No IN-PACKAGE form seen in factorial.lisp. (Allegro Presto will be ineffective when loading a file having no IN-PACKAGE form.) ;;; Fasl write complete ; Fast loading factorial.fasl ;Comment: name of file created with compiled code USER(9): (factorial 4) 24
The command ":cd" changes the current working directory. ":pwd" prints the
current working directory.
USER(15): :cd cs351-code cs351-code/ USER(16): :pwd Lisp's current working directory is "/v/hank/v43/mooney/cs351-code/" *default-pathname-defaults* is #p""
To terminate the Lisp system, use the command ":exit" or call the function
"(exit)."
USER(3): :exit ; killing "Editor Server" ; killing "Run Bar Process" ; killing "Listener Socket Daemon" ; killing "Initial Lisp Listener" ; Exiting Lisp
[1] USER(15): :zo Evaluation stack: (ERROR TYPE-ERROR :DATUM ...) ->(APPEND . 2) (FACTORIAL 0) (FACTORIAL 1) (FACTORIAL 2) (FACTORIAL 3) (FACTORIAL 4) (FACTORIAL 5) (FACTORIAL 6) ... more older frames ...If you start Allegro "composer" from the Emacs menu item "Composer" that Allegro adds, you can then call the window debugger using ":wdebug".
[1] USER(17): :wdebug Bringing up a window debugger for #MULTIPROCESSING:PROCESS Initial Lisp Listener @ #x8081d4a... Window debugger is now active.The window debugger allows you to examine and manipulate the calling stack in various ways. Right-click in the left margin of a frame to bring up a menu of commands for this frame, or right-click on a function name or argument to bring up a menu of options for that item.
The commands ":dn" and ":up:" will move your current position up and down the stack. The command ":local var-name" will show you the value of the local variable var-name at the current point in the stack. For example:
USER(14): (defun factorial (x) (if (zerop x) nil (* x (factorial (- x 1))))) FACTORIAL USER(15): (factorial 10) Error: `NIL' is not of the expected type `NUMBER' [condition type: TYPE-ERROR] Restart actions (select using :continue): 0: Return to Debug Level 1 (an "abort" restart) 1: continue computation 2: Return to Top Level (an "abort" restart) [1] USER(16): :zo Evaluation stack: (ERROR TYPE-ERROR :DATUM ...) ->(* 1 NIL) (FACTORIAL 1) (FACTORIAL 2) (FACTORIAL 3) (FACTORIAL 4) (FACTORIAL 5) (FACTORIAL 6) (FACTORIAL 7) ... more older frames ... [1] USER(17): :local x 1 1 [1] USER(18): :dn Evaluation stack: (ERROR TYPE-ERROR :DATUM ...) (* 1 NIL) ->(FACTORIAL 1) (FACTORIAL 2) (FACTORIAL 3) (FACTORIAL 4) (FACTORIAL 5) (FACTORIAL 6) (FACTORIAL 7) ... more older frames ... [1] USER(19): :dn Evaluation stack: (ERROR TYPE-ERROR :DATUM ...) (* 1 NIL) (FACTORIAL 1) ->(FACTORIAL 2) (FACTORIAL 3) (FACTORIAL 4) (FACTORIAL 5) (FACTORIAL 6) (FACTORIAL 7) ... more older frames ... [1] USER(20): :dn Evaluation stack: ... 1 more (possibly invisible) newer frame ... (ERROR TYPE-ERROR :DATUM ...) (* 1 NIL) (FACTORIAL 1) (FACTORIAL 2) ->(FACTORIAL 3) (FACTORIAL 4) (FACTORIAL 5) (FACTORIAL 6) (FACTORIAL 7) ... more older frames ... [1] USER(21): :local x 3 3