For people trying this out on a Scheme such as Chicken that does not have the ‘assp function (which appears to have been added in r6rs), the following should work:
(define (assp p l)
(cond ((null? l) #f)
((p (car l)) (car l))
(else (assp p (cdr l)))))
For people trying this out on a Scheme such as Chicken that does not have the ‘assp function (which appears to have been added in r6rs), the following should work:
(please correct me if I’m missing something here)