X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=main.scm;h=df8e656978b66349472e5a3599c12f5eb809f7f4;hb=190fc656a7b4e12e6fcf640c56e6ff71b5a39e40;hp=e2e96b8355b68cd43967977259c67ab91f7a5e1e;hpb=8519507b78d723100bca15fe0332ff99890e77fa;p=scheme.git diff --git a/main.scm b/main.scm index e2e96b8..df8e656 100644 --- a/main.scm +++ b/main.scm @@ -28,8 +28,13 @@ (define target (car (parse-args))) (define file (cadr (parse-args))) +(define (read-prog port) + (if (port-input-empty? port) + '() + (cons (read) (read-prog port)))) + (compile-to-binary (if (eqv? file 'stdin) - (read) - (call-with-input-file file read)) + (read-prog (current-input-port)) + (call-with-input-file file read-prog)) "a.out" target)