Am Mi., 10. Juni 2020 um 10:03 Uhr schrieb Arne Babenhauserheide <xxxxxx@web.de>:

> If you need `cdr' after `assoc' very often, I'd use a helper procedure like
> this one:
>
> (define (assoc-ref key alist)
>   (and-let* ((entry (assoc key alist)))
>     (cdr entry)))
>
> This way, you don't have any magic `cdr's in your code and you express your
> intent as clearly as possible.  (And choose whatever style you want in the
> body of `assoc-ref'. :))

This breaks the correctnsess of assoc: That #f is always unambigous as
"not found". That’s why I want to preserve the behaviour and only unpack
in the final processing.

Yes, you are right in case `#f' is a valid value in your association list.
If this is the case, you can code it in a data-driven style with SRFI 189:

(define (assoc-ref key alist)
  (maybe-bind (list->maybe (assoc key alist)) cdr))

It returns either a Nothing or Just the associated value.