Implement till 5.39

This commit is contained in:
2021-04-22 09:05:18 -04:00
parent 360f740441
commit 54bc6725f3
4 changed files with 141 additions and 118 deletions

View File

@@ -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