[EMAIL PROTECTED] (Gerd Moellmann) writes:

> Christian Lynbech <[EMAIL PROTECTED]> writes:
>
>> Is there a simple way (ie. without replacing the standard REPL) to
>> make errors merely print out and not going into the debugger?
>
> Maybe something like this?
>
> CL-USER ==> (defun debug::real-invoke-debugger (condition)
>   (format *error-output* "~&~a~%" condition)
>   (throw 'lisp::top-level-catcher nil))
> debug::real-invoke-debugger
> CL-USER ==> (cons 1)
> Invalid number of arguments: 1
> CL-USER ==> (/ 1 0)
> Arithmetic error division-by-zero signalled.
> Operation was kernel::division, operands (1 0).
> CL-USER ==> 

Why suggest non-portable code when portable code will do?

* (defun select-abort (condition self)
    (declare (ignore self))
    (format *error-output* "~&~A~%" condition) 
    (abort condition))

SELECT-ABORT
* (setf *debugger-hook* #'select-abort)

#<FUNCTION SELECT-ABORT>
* (max #\Space)
The value #\Space is not of type REAL.

* (/ 1.0 0.0)
arithmetic error DIVISION-BY-ZERO signalled

Cheers,

Christophe
-- 
http://www-jcsu.jesus.cam.ac.uk/~csr21/       +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%")    (pprint #36rJesusCollegeCambridge)

Reply via email to