Files
scm-to-vm/scmvm.scm

14 lines
350 B
Scheme
Raw Permalink Normal View History

2025-06-11 10:50:38 -05:00
(define-module (scmvm)
#:use-module (ice-9 ports)
#:export (read-all-instructions
instructions-from-file))
2025-06-09 09:02:20 -05:00
2025-06-11 10:50:38 -05:00
(define (read-all-instructions)
(let ([inst (read)])
(if (eof-object? inst)
'()
(cons inst (read-all-instructions)))))
2025-06-09 09:02:20 -05:00
2025-06-11 10:50:38 -05:00
(define (instructions-from-file file)
(with-input-from-file file read-all-instructions))