[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: *break-driver*



Roger Kehr <kehr@iti.informatik.th-darmstadt.de> writes:
> 
> Normally, the system just tells me
> 
> 	*** - Ctrl-C: User break
> 
> but continues running. This is a very unsatisfying behavior in an
> UNIX environment.

Yes, I agree.

> After some investigation of the code I found that the function bound
> to the variable *BREAK-DRIVER* is used to handle these kind of breaks.
> 
> My idea was now to bind a function like the following to
> *BREAK-DRIVER*.
> 
> 1. Is this a good way of handling this situation?

Yes. Except that the code to print the condition should better read like
this:

  (when (and condition print-it)
    (terpri *error-output*)
    (write-string "*** - " *error-output*)
    (print-condition condition *error-output*)
  )

because if print-it is NIL, the condition has already been printed by
the caller, and you shouldn't use the SIMPLE-ERROR accessors unless
you have verified that the condition is of type SIMPLE-ERROR (it could
also be a WARNING if *break-on-warnings* is true).

>    It seems to work quiet fine.
> 
> 2. Is there a better way of handling this?

Not for now.

In order to handle normal conditions (not Ctrl-C) you could use the
EXIT-ON-ERROR and APPEASE-CERRORS macros documented in impnotes.txt.


                           Bruno


! To unsubscribe from the clisp-list mailing list, send mail to     !
!               listserv@ma2s2.mathematik.uni-karlsruhe.de          !
! including the two words "unsubscribe clisp-list" as message body. !