Unexpected behaviour in find for sbcl 1.4.16 and later

Bug #1823091 reported by Gabriel Poulin-Lamarre
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

The function find does not return anything when it is called the same way as below

Example:
CL-USER> (let ((n nil))
           (setq n 1.2) (find n '((1.2)) :key #'car))
NIL

The behaviour is present in SBCL version 1.4.16 and higher. The version 1.3.0 works properly.

It returns the proper value when n is initialized to the same element as the sequence, when the test #'eql is explicitly called or when the sequence is (list (list ..)).

Example:

CL-USER> (let ((n 1.2))
           (setq n 1.2) (find n '((1.2)) :key #'car)) ;; initialize n as 1.2
(1.2)

CL-USER> (let ((n nil))
           (setq n 1.2) (find n '((1.2)) :key #'car :test (lambda (x y) (eql x y)))) ;; Explicitly call the test
(1.2)

CL-USER> (let ((n nil))
           (setq n 1.2) (find n (list (list 1.2)) :key #'car)) ;;change the tick for lists
(1.2)

It is possible to reproduce the same problem without double floats

CL-USER> (let ((n nil))
           (setq n #xFFFFFFFFFFFFFFFF)
           (find n '((#xFFFFFFFFFFFFFFFF)) :key #'car :test #'eql))
NIL

Revision history for this message
Stas Boukarev (stassats) wrote :

ee82b69af93c0803516035413a049cf087c08f1d

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.