(define (mdalconfig-proc #!key version target (description "a default description") commands input output) (unless (= version 2) (error "Version is wrong")) (print "target is: " target) (print description) #;(do-whatever commands input output)) (define data (with-input-from-file "data" read)) ;; You can replace this if with a hash-table lookup ;; if you have multiple commands, for example. (if (and (pair? data) (eqv? (car data) 'mdalconfig)) ;; this is where the magic happens (apply mdalconfig-proc (cdr data)) (error "unknown configuration command"))