scm-to-vm/scmvm.scm

16 lines
436 B
Scheme

(define-module (scmvm)
#:use-module (scmvm vm)
#:use-module (scmvm assembler)
#:use-module (scmvm debugger)
#:use-module (ice-9 ports)
#:export (read-all-instructions instructions-from-file))
(define (read-all-instructions)
(let ([inst (read)])
(if (eof-object? inst)
'()
(cons inst (read-all-instructions)))))
(define (instructions-from-file file)
(with-input-from-file file read-all-instructions))