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

structure equality in slisp

   From: David.Butcher at ML.RI.CMU.EDU
   To:   Gripe at ML.RI.CMU.EDU
   Re:   structure equality in slisp

  (equal (make-point) (make-point)) returned nil.

  a point is just three slots containing a number each.

  according to the book, things that have the same print name are equal.
  so shouldn't equal work on structures?

Unfortunately, EQUAL is not a structural equality predicate.  For
historical reasons, EQUAL on any atom other than a string (or a
bit-vector) is equivalent to EQL.  Even worse, *there is no structural
equality predicate* in Common Lisp.  You can use EQUALP, but then
comparisons of characters are case-insensitive.  Yes, this is
misleading, confusing and inconsistent.  I think it sucks.  Flame