mes: assq, assoc-ref: Handle non-A-LISTs.
* src/mes.c (assq): Return #f if A-LIST is not a list. * module/mes/scm.mes (assoc): Likewise.
This commit is contained in:
parent
8911af4aa8
commit
c20ef52f6f
|
@ -109,7 +109,7 @@
|
||||||
(define assv-ref assq-ref)
|
(define assv-ref assq-ref)
|
||||||
|
|
||||||
(define (assoc key alist)
|
(define (assoc key alist)
|
||||||
(if (null? alist) #f
|
(if (not (pair? alist)) #f
|
||||||
(if (equal? key (caar alist)) (car alist)
|
(if (equal? key (caar alist)) (car alist)
|
||||||
(assoc key (cdr alist)))))
|
(assoc key (cdr alist)))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue