On Thu, 26 Aug 2004, Yukihiro Matsumoto wrote:

> Hi,
>
> In message "Re: POLS - exception comparisons"
>    on 04/08/25, Jamis Buck <jgb3 / email.byu.edu> writes:
>
> |It depends on what you are asking when you want to know if two
> |exceptions are the same. I can see where, on one hand, you would want
> |them to be equal if they contain the same information, but on the other
> |hand, sometimes you might want to know: are these two objects the same
> |exception that was thrown at some instant x? In that case, it isn't
> |sufficient to merely check the exception's contents, you have to make
> |sure they have the same id and are literally the same object.
>
> Indeed.  But you can use "equal?" for the same instant.  The point is
> that which should be the basic comparison (the comparison used most
> frequently).
>
> 							matz.

IMHO - this is

   "is the error produced by the same condition from the same location in the
   code"

eg.

   "is it the same bug/problem"

time is an external actor to a bug (generally) - eg. we'd get the 'same' error
at any point in time given the same pre-conditions and therefore they are
equivalent.  therefore a possible impl is

   self.class == other.class and
   self.message == other.message and
   self.backtrace == other.backtrace

my 2cts.

kind regards.

-a
--
===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| A flower falls, even though we love it;
| and a weed grows, even though we do not love it. 
|   --Dogen
===============================================================================