Implement till 5.39
This commit is contained in:
23
util.scm
23
util.scm
@@ -129,27 +129,4 @@
|
||||
|
||||
(define integers (cons-stream 1 (add-streams ones integers)))
|
||||
|
||||
(define (compile-to-file code target linkage file-name)
|
||||
(set! label-counter 0)
|
||||
(define (write-list-to-port xs port)
|
||||
(if (null? xs)
|
||||
'()
|
||||
(begin
|
||||
(display (car xs) port)
|
||||
(display "\n" port)
|
||||
(write-list-to-port (cdr xs) port))))
|
||||
(if #t ; #t means write to file; #f means don't write to file
|
||||
(let* ((compile-result (compile code target linkage))
|
||||
(assembly-insts (statements compile-result))
|
||||
(port (open-output-file file-name)))
|
||||
(write-list-to-port assembly-insts port)
|
||||
(display "[")
|
||||
(display file-name)
|
||||
(display "]\n")
|
||||
(close-output-port port))
|
||||
(begin
|
||||
(display "[")
|
||||
(display file-name)
|
||||
(display "]\n"))))
|
||||
|
||||
'util-loaded
|
||||
|
||||
Reference in New Issue
Block a user