Welcome to the CHICKEN Scheme pasting service
no title added by terpri on Wed May 28 16:13:44 2014
(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: #<procedure (list-ref lst i)>