Subject: Re: minor stuff with CMU Lisp
From: (Rob Warnock)
Date: Sat, 14 Oct 2006 21:15:26 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
Mark Tarver <> wrote:
| I'm experimenting with CMU Lisp...
| 1.  Error messages are printed but with the accompanying
|      'Error in function ...." tagged to them; giving the
|      function in which the error was raised.   Actually I
|      don't want this - is there any way to turn this feature off?

Why? Don't you want to know where the error occurred?  ;-}

Anyway, if you are not "debugging" per se but just noodling around
in the REPL and don't want to drop into the debugger every time
you typo or violate a function signature, you might like something
like the following [not specific to CMUCL, actually]:

    > (defun my-debugger-hook (c hook)
	(declare (ignore hook))
	(when (find-restart 'abort c)
	  (princ c)
	  (abort c)))

    > (setf *debugger-hook* 'my-debugger-hook)

    > (/ 1 0)
    Arithmetic error DIVISION-BY-ZERO signalled.
    Operation was KERNEL::DIVISION, operands (1 0).
    > (length 34)
	    34 is not of type SEQUENCE
    > (length 12 34)
    Invalid number of arguments: 2
    > (mapcar '1+ '(12 34 foo 56))
    Argument X is not a NUMBER: FOO.

And you can always undo it temporarily if you *do* want the full
debugger functionality for a specific expression evaluation:

    > (let ((*debugger-hook* nil))
	(mapcar '1+ '(12 34 foo 56)))

    Argument X is not a NUMBER: FOO.
       [Condition of type SIMPLE-TYPE-ERROR]

      0: [ABORT] Return to Top-Level.

    Debug  (type H for help)

    Source: Error finding source: 
    Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM:  Source file no longer exists:

| 2.  Compiler messages. CMU likes to chat and I'm trying to still it.

Again, one wonders why. One of the major *advantages* of CMUCL is
its extremely-helpful compiler notes.

| I have
|      *GC-VERBOSE*
| set to NIL.  However I'm still getting some chat, is there a
| setting I've missed?

Are you sure you're getting "chat" and not just the *values*
from the COMPILE-FILE? E.g., this may look like "chat":

    > (compile-file "foo" :print nil :verbose nil)


but it's really just the values from COMPILE-FILE. If you throw
them away, you get nothing:

    > (progn (compile-file "foo-hash" :print nil :verbose nil) 34)



Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607