comparison lisp/cl-extra.el @ 4728:d0ea57eb3de4

Don't error if handed a string and a non-string, #'equalp. tests/ChangeLog addition: 2009-11-01 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el: Check that (equal "hi there" [hi there]) gives nil, instead of erroring; fixes a bug Ben introduced in 2002. lisp/ChangeLog addition: 2009-11-01 Aidan Kehoe <kehoea@parhasard.net> * cl-extra.el (equalp): Don't error if handed a string and a non-string.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 01 Nov 2009 15:05:46 +0000
parents b5e1d4f6b66f
children 95b04754ea8c
comparison
equal deleted inserted replaced
4727:90dbf8e772b6 4728:d0ea57eb3de4
95 numbers of different types (float vs. integer), and also compares 95 numbers of different types (float vs. integer), and also compares
96 strings case-insensitively." 96 strings case-insensitively."
97 (cond ((eq x y) t) 97 (cond ((eq x y) t)
98 ((stringp x) 98 ((stringp x)
99 ;; XEmacs change: avoid downcase 99 ;; XEmacs change: avoid downcase
100 (eq t (compare-strings x nil nil y nil nil t))) 100 (and (stringp y)
101 (eq t (compare-strings x nil nil y nil nil t))))
101 ;; XEmacs addition: compare characters 102 ;; XEmacs addition: compare characters
102 ((characterp x) 103 ((characterp x)
103 (and (characterp y) 104 (and (characterp y)
104 (or (char-equal x y) 105 (or (char-equal x y)
105 (char-equal (downcase x) (downcase y))))) 106 (char-equal (downcase x) (downcase y)))))