Incorrect result from EQUALP with type declarations

Bug #1732225 reported by Paul F. Dietz on 2017-11-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
High
Unassigned

Bug Description

(defun f21 (s1 s2)
  (let* ((lam
          `(lambda (p1 p2)
             (declare (type (member ,s1 nil 1 #\l) p1)
                      (type (member ,s2 #\p -6) p2))
             (equalp p1 p2))))
    (funcall (compile nil lam) s1 s2)))

(f21 "b" "b") ==> NIL

(equalp "b" "b") ==> T

Paul F. Dietz (paul-f-dietz) wrote :

Error, code should have been

(defun f21 (s1 s2)
  (let* ((lam
          `(lambda (p1 p2)
             (declare (type (member ,s1 nil \l) p1)
                      (type (member ,s2 #\p -6) p2))
             (equalp p1 p2))))
    (funcall (compile nil lam) s1 s2)))

Paul F. Dietz (paul-f-dietz) wrote :

Augh

Incorrect result from EQUALP with type declarations Edit
Bug #1732225 reported by Paul F. Dietz 4 minutes ago
6
This bug affects you Edit
Affects Status Importance Assigned to Milestone

  SBCL

New

Undecided

  Unassigned

Also affects project (?) Also affects distribution/package
Edit
Bug Description

(defun f21 (s1 s2)
  (let* ((lam
          `(lambda (p1 p2)
             (declare (type (member ,s1 nil 1 #\l) p1)
                      (type (member ,s2 #\p -6) p2))
             (equalp p1 p2))))
    (funcall (compile nil lam) s1 s2)))

(f21 "b" "b") ==> NIL

(equalp "b" "b") ==> T
Add tags Tag help
See full activity log
Paul F. Dietz (paul-f-dietz) wrote a moment ago: #1

Error, code should have been

(defun f21 (s1 s2)
  (let* ((lam
          `(lambda (p1 p2)
             (declare (type (member ,s1 nil #\l) p1)
                      (type (member ,s2 #\p -6) p2))
             (equalp p1 p2))))
    (funcall (compile nil lam) s1 s2)))

Stas Boukarev (stassats) on 2017-11-14
Changed in sbcl:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Stas Boukarev (stassats)
Stas Boukarev (stassats) wrote :

0a1435311b7f2c118b04c214aa6043757cb72dbf

Changed in sbcl:
status: Triaged → Fix Committed
assignee: Stas Boukarev (stassats) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers