1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 13:00:26 +02:00

* hcons.scm (hashq-cons-assoc): Don't assume the empty list is

false.  Return false when we cannot find a matching entry in the
list.  (Thanks to Andrew Archibald.)
This commit is contained in:
Jim Blandy 1998-07-19 04:28:51 +00:00
parent 3910272e9f
commit 048a208ec0

View file

@ -36,13 +36,14 @@
n)) n))
(define-public (hashq-cons-assoc key l) (define-public (hashq-cons-assoc key l)
(and l (or (and (pair? l) (and (not (null? l))
(pair? (car l)) (or (and (pair? l) ; If not a pair, use its cdr?
(pair? (caar l)) (pair? (car l))
(eq? (car key) (caaar l)) (pair? (caar l))
(eq? (cdr key) (cdaar l)) (eq? (car key) (caaar l))
(car l)) (eq? (cdr key) (cdaar l))
(hashq-cons-assoc key (cdr l))))) (car l))
(hashq-cons-assoc key (cdr l)))))
(define-public (hashq-cons-get-handle table key) (define-public (hashq-cons-get-handle table key)
(hashx-get-handle hashq-cons-hash hashq-cons-assoc table key #f)) (hashx-get-handle hashq-cons-hash hashq-cons-assoc table key #f))