From: Fernando Rodríguez
Subject: Aborting automaticaly on errors in the repl
Date: 
Message-ID: <a33bd841831c8c8a46d73362af8@news.uned.es>
Hi,

Is there a way to make lispworks automaticaly abort on all errors in the 
repl? Most of the time, the errors are simple typos, and having to go through 
the list of options every time to find the abort option (and  it's not even 
always the same!) is a pain in the behind...

Thanks in advance

From: Espen Vestre
Subject: Re: Aborting automaticaly on errors in the repl
Date: 
Message-ID: <m1ventzdcx.fsf@doduo.netfonds.no>
Fernando Rodr�guez <···@fernando-rodriguez.com> writes:

> Hi,
> 
> Is there a way to make lispworks automaticaly abort on all errors in
> the repl? Most of the time, the errors are simple typos, and having to
> go through the list of options every time to find the abort option
> (and  it's not even always the same!) is a pain in the behind...
> 
> Thanks in advance

Type :a !
-- 
  (espen)
From: Pascal Bourguignon
Subject: Re: Aborting automaticaly on errors in the repl
Date: 
Message-ID: <87mz95fewb.fsf@thalassa.informatimago.com>
Fernando Rodr�guez <···@fernando-rodriguez.com> writes:
> Is there a way to make lispworks automaticaly abort on all errors in
> the repl? Most of the time, the errors are simple typos, and having to
> go through the list of options every time to find the abort option
> (and  it's not even always the same!) is a pain in the behind...

You can write your own REPL.

For example:


(defmacro handling-errors (&body body)
  `(HANDLER-CASE (progn ,@body)
     (simple-condition 
         (ERR) 
       (format *error-output* "~&~A: ~%" (class-name (class-of err)))
       (apply (function format) *error-output*
              (simple-condition-format-control   err)
              (simple-condition-format-arguments err))
       (format *error-output* "~&")
       (finish-output))
     (condition 
         (ERR) 
       (format *error-output* "~&~A: ~%  ~S~%"
               (class-name (class-of err)) err)
       (finish-output)))))


(defun repl ()
  (do ((+eof+ (gensym))
       (hist 1 (1+ hist)))
      (nil)
    (format t "~%~A[~D]> " (package-name *package*) hist)
    (finish-output)
    (handling-errors
     (setf - (read *standard-input* nil +eof+))
     (when (or (eq - +eof+)
               (member - '((quit)(exit)(continue)) :test (function equal)))
       (return-from repl))
     (let ((results (multiple-value-list (eval -))))
       (shiftf +++ ++ + -)
       (shiftf /// // / results)
       (shiftf *** ** * (first /)))
     (format t "~& --> ~{~S~^ ;~%     ~}~%" /)
     (finish-output))))




-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

"Indentation! -- I will show you how to indent when I indent your skull!"
From: sross
Subject: Re: Aborting automaticaly on errors in the repl
Date: 
Message-ID: <1158141430.543060.22180@m73g2000cwd.googlegroups.com>
Fernando Rodríguez wrote:
> Hi,
>
> Is there a way to make lispworks automaticaly abort on all errors in the
> repl?

you could provide a value for *debugger-hook* .

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

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



sean.
From: Fernando Rodríguez
Subject: Re: Aborting automaticaly on errors in the repl
Date: 
Message-ID: <a33bd841903a8c8a5f21077a5a0@news.uned.es>
Hello sross,
>> Is there a way to make lispworks automaticaly abort on all errors in
>> the repl?
>> 
> you could provide a value for *debugger-hook* .
> 
> (defun my-debugger-hook (c hook)
> (declare (ignore hook))
> (when (find-restart 'abort c)
> (princ c)
> (abort c)))
> (setf *debugger-hook* 'my-debugger-hook)


Much better now. Thanks! :-)