(define (foo x y) (define (append-map proc . lsts) (if (null? lsts) (proc 1) (apply proc lsts))) (append-map (lambda (a) (print a))) (append-map (lambda (a b) (print a b)) x y)) ;; $ ./csc -O2 ../fail.scm && ../fail ;; ;; Error: ../fail.scm:31: proc: procedure `proc' called with wrong number of arguments