mes: assq-ref, assoc-ref: Support alist == #f.
* mes/module/mes/scm.mes (assq-ref): Support alist == #f. (assoc-ref): Likewise.
This commit is contained in:
parent
750fef8dfb
commit
e90aed9d1b
|
@ -101,17 +101,19 @@
|
|||
alist))))
|
||||
|
||||
(define (assq-ref alist key)
|
||||
(let ((entry (assq key alist)))
|
||||
(if entry (cdr entry)
|
||||
#f)))
|
||||
(and alist
|
||||
(let ((entry (assq key alist)))
|
||||
(if entry (cdr entry)
|
||||
#f))))
|
||||
|
||||
(define assv assq)
|
||||
(define assv-ref assq-ref)
|
||||
|
||||
(define (assoc-ref alist key)
|
||||
(let ((entry (assoc key alist)))
|
||||
(if entry (cdr entry)
|
||||
#f)))
|
||||
(and (pair? alist)
|
||||
(let ((entry (assoc key alist)))
|
||||
(if entry (cdr entry)
|
||||
#f))))
|
||||
|
||||
(define (assoc-set! alist key value)
|
||||
(let ((entry (assoc key alist)))
|
||||
|
|
Loading…
Reference in a new issue