But you need to handle the empty case anyway otherwise you process nils ad infinitum.
(if lst
...)
if the empty list is falsy, but Scheme eventually chose to add #t and #f. Oddly #f is the only false value but #t is not the only true value.Describes the evolution from:
(cdr (assq key a-list))
to: (let ((val (assq key a-list)))
(cond ((not (null? val)) (cdr val))
(else nil)))