changed compile-expr to expand first

This commit is contained in:
Abdulaziz Ghuloum 2006-12-06 21:20:15 -05:00
parent cd4eef2382
commit 5abcbccb3a
3 changed files with 15 additions and 4 deletions

Binary file not shown.

View File

@ -243,6 +243,8 @@
(define (unique-var x)
(make-var (gensym x) #f #f))
(define (recordize x)
(define (gen-fml* fml*)
(cond
@ -4597,7 +4599,8 @@
))))
(define (compile-expr expr)
(let* ([p (recordize expr)]
(let* ([p (expand expr)]
[p (recordize p)]
[p (optimize-direct-calls p)]
[p (optimize-letrec p)]
[p (uncover-assigned/referenced p)]
@ -4635,7 +4638,7 @@
(let f ()
(let ([x (read ip)])
(unless (eof-object? x)
(fasl-write (compile-expr (expand x)) op)
(fasl-write (compile-expr x) op)
(f))))
(close-input-port ip)
(close-output-port op))))
@ -4644,7 +4647,7 @@
(primitive-set! 'assembler-output (make-parameter #f))
(primitive-set! 'compile
(lambda (x)
(let ([code (compile-expr (expand x))])
(let ([code (compile-expr x)])
(let ([proc ($code->closure code)])
(proc)))))

View File

@ -231,6 +231,14 @@
))
(define (expand-file ifile)
(with-input-from-file ifile
(lambda ()
(let f ()
(let ([x (read)])
(unless (eof-object? x)
(sc-expand x)
(f)))))))
(define (compile-library ifile ofile)
(parameterize ([assembler-output #f]
@ -238,6 +246,7 @@
[interaction-environment system-env])
(printf "compiling ~a ... " ifile)
(compile-file ifile ofile 'replace)
;(expand-file ifile)
(newline)))
(for-each
@ -246,7 +255,6 @@
(compile-library (car x) (caddr x))))
scheme-library-files)
(define (join s ls)
(cond
[(null? ls) ""]