I’ve got
(define (compiler exp)
(define (printer line) (display line) (newline))
(init-generators)
(let ((res (compile (append bootstrap (list exp)) function-res '())))
(map printer c-string-list)
(display bootstrap-c-code)
(add-c-function 'startup '(env) res)
(map (lambda (function) (map printer function) (newline)) c-function-list)
'ok))
and I need
(define (compile file-name)
(compiler (load file-name)))
But it doesn’t work this way. It’s executing directly. How can I load it as expression? (exp)
Are you looking for the
readfunction, as opposed toload? Without knowing more about the implementation you’re using, I can only point to the read documentation from r5rs. Useopen-input-fileto get a port from the filename, and then read from that port.