(define (maybe fn #!rest args #!key (pred (lambda (x) x)) (otherwise '())) (if (pred args) (apply fn args) otherwise)) (maybe list-ref '(1 2 3 4 5) 2 pred: (lambda (x) #t)) ; => Error: bad argument count - received 4 but expected 2: #