Unexpected behaviour in find for sbcl 1.4.16 and later

Bug #1823091 reported by Gabriel Poulin-Lamarre on 2019-04-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
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

Stas Boukarev (stassats) wrote :

ee82b69af93c0803516035413a049cf087c08f1d

Changed in sbcl:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers