1 #!/usr/bin/scheme --script
6 ; returns (os filename)
9 (if (null? x) host-os ; todo: replace this with the os
10 ; it was compiled with
12 (or (equal? (car x) "-t")
13 (equal? (car x) "--target"))
17 (else (error #f "unknown os")))
19 (define (parse-file x)
22 (or (equal? (car x) "-t")
23 (equal? (car x) "--target"))
26 (let ((args (cdr (command-line))))
27 (list (parse-os args) (parse-file args))))
30 (define target (car (parse-args)))
31 (define file (cadr (parse-args)))
33 ; reads in all datums until eof
34 (define (read-prog port)
35 (let ([x (read port)])
38 (cons x (read-prog port)))))
41 (if (eqv? file 'stdin)
42 (read-prog (current-input-port))
43 (call-with-input-file file read-prog))