1(define (parse-input port)2 (let ((r (parse-readit port)))3 (if r r (error "syntax error" port))))45(define (parse-files fps)6 (define (ensure-present fps)7 (for-each (lambda (fp)8 (unless (file-exists? fp)9 (error "file does not exist" fp))) fps))1011 ;; According to the CHICKEN documentation, files passed to12 ;; call-with-input-file "should already exist".13 (ensure-present fps)1415 (fold (lambda (fp entries)16 (append (call-with-input-file17 fp parse-input) entries))18 '() fps))1920(define (parse-args flags)21 (args-fold22 (command-line-arguments)23 flags24 (lambda (o n x vals)25 (error "unrecognized option" n))26 cons27 '()))