projects
/
scheme.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of lukelau.me:/srv/git/scheme
[scheme.git]
/
main.scm
diff --git
a/main.scm
b/main.scm
index ce9241ac11537abaf0766e6876e138b24645efd3..df8e656978b66349472e5a3599c12f5eb809f7f4 100644
(file)
--- a/
main.scm
+++ b/
main.scm
@@
-1,9
+1,10
@@
(load "codegen.scm")
(load "codegen.scm")
+(load "platform.scm")
; returns (os filename)
(define (parse-args)
(define (parse-os x)
; returns (os filename)
(define (parse-args)
(define (parse-os x)
- (if (null? x)
'darwin
; todo: replace this with the os
+ (if (null? x)
host-os
; todo: replace this with the os
; it was compiled with
(if
(or (equal? (car x) "-t")
; it was compiled with
(if
(or (equal? (car x) "-t")
@@
-27,8
+28,13
@@
(define target (car (parse-args)))
(define file (cadr (parse-args)))
(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)
(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)
"a.out" target)