Handle :case-sensitive properly
Wed Jan 20 08:27:09 UTC 2010 pix@kepibu.org
* Handle :case-sensitive properly
If the first clause doesn't match due to mismatched case, it would
roll down to the second clause, causing case-differing strings to
erroneously match. By checking for case again, we can avoid this.
Note, however, that this does not fix the similar but unrelated
inconsistent usage of *unify-string-case-sensitive-p* and
*unify-string-case-insensitive-p* (the former being used in the code
and the latter appearing in documentation). That bug will remain
until the canonical form is decided upon.
diff -rN -u old-cl-unification-1/unifier.lisp new-cl-unification-1/unifier.lisp
--- old-cl-unification-1/unifier.lisp 2013-07-21 19:25:59.000000000 +0000
+++ new-cl-unification-1/unifier.lisp 2013-07-21 19:25:59.000000000 +0000
@@ -96,7 +96,7 @@
otherwise an error of type UNIFICATION-FAILURE is signaled."
(cond ((and case-sensitive (char= a b))
env)
- ((char-equal a b)
+ ((and (not case-sensitive) (char-equal a b))
env)
(t
(error 'unification-failure
@@ -118,7 +118,7 @@
otherwise an error of type UNIFICATION-FAILURE is signaled."
(cond ((and case-sensitive (string= a b))
env)
- ((string-equal a b)
+ ((and (not case-sensitive) (string-equal a b))
env)
(t
(error 'unification-failure