From: Eoin Wren
Subject: Is there a way to catch error signals?
Date: 
Message-ID: <Do6C5p.JxK@news.tcd.ie>
I am writing a function, which generates two list.
One list is a list of object on which a particular function operates correctly.
The second list is a list of all objects which generate an error when a particular function is applied to them. 
However I need some way to catch the error signal and stop the program entering the debugger.

Is there a way to do this???



Thanks.



-------------------------------------------------------------------------------

Eoin Wren
3rd yr Computer Science 			   ·············@alf2.tcd.ie 
Trinity College Dublin

------------------------------------------------------------------------------

From: dcwhite
Subject: Re: Is there a way to catch error signals?
Date: 
Message-ID: <4i8237$5fd@gryphon.phoenix.net>
In article <··········@news.tcd.ie>, ······@tcd.ie (Eoin 
Wren) wrote:
>
>I am writing a function, which generates two list.
>One list is a list of object on which a particular function 
operates correctly.
>The second list is a list of all objects which generate an 
error when a particular function is applied to them. 
>However I need some way to catch the error signal and stop 
the program entering the debugger.
>
>Is there a way to do this???
>
>
>
>Thanks.
>
>
>
>------------------------------------------------------------
-------------------
>
>Eoin Wren
>3rd yr Computer Science 			   
·············@alf2.tcd.ie 
>Trinity College Dublin
>
>------------------------------------------------------------
------------------

This may not be the answer that you were looking for.  I am 
using a lisp that is a bit different than common lisp, and I 
obtained the source code with the package.  Thus, I can go 
into my debugger and modify it, if required.

Another way to approach this is to use a THROW to exit the 
function in question.  For example, when you see the function 
that normally causes an error, a THROW command stops 
execution at that point, and program flow control goes to the 
CATCH statement named by the THROW command.  Hopefully, your 
system has similar functionality.  For the record, I am using 
MuLisp90, from Soft Warehouse.  Good luck with your problem.

·······@phoenix.net
From: Carl L. Gay
Subject: Re: Is there a way to catch error signals?
Date: 
Message-ID: <CGAY.96Mar16025324@ix.cs.uoregon.edu>
   ······@tcd.ie (Eoin Wren) wrote:

   >I am writing a function, which generates two list.
   >One list is a list of object on which a particular function 
   operates correctly.
   >The second list is a list of all objects which generate an 
   error when a particular function is applied to them. 
   >However I need some way to catch the error signal and stop 
   the program entering the debugger.
   >
   >Is there a way to do this???

If you're using Common Lisp, the following should work:

(handler-case (call-the-function-that-may-err object)
  (ERROR   ;; Ideally you want to use a more specific condition class.
           ;; For example, DIVISION-BY-ZERO.
    (push object bad-list))
  (:no-error
    (push object good-list)))

-Carl