[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
structure equality in slisp
- To: David.Butcher@ML.RI.CMU.EDU
- Subject: structure equality in slisp
- From: Rob MacLachlan <RAM@C.CS.CMU.EDU>
- Date: Mon, 16 Sep 1985 18:14:00 -0000
- Cc: Gripe@ML.RI.CMU.EDU, Scott.Fahlman@C.CS.CMU.EDU, Skef.Wholey@C.CS.CMU.EDU, common-lisp@SU-AI.ARPA
- In-reply-to: Msg of 13 Sep 1985 14:23-EDT from David.Butcher at ML.RI.CMU.EDU
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
flame.
Rob