Fixed from-file so that it produces more than just one line of output.

This commit is contained in:
Jim Rees 2018-03-22 09:50:34 -04:00
parent d0b63109e8
commit ece2d470c3

View file

@ -464,15 +464,15 @@
cons)) cons))
"\n")))))) "\n"))))))
(define (from-file path) (define (from-file path . ls)
(let-optionals* ls ((sep nl))
(fn () (fn ()
(call-with-input-file path (let ((in (open-input-file path)))
(lambda (in)
(let lp () (let lp ()
(let ((line (read-line in))) (let ((line (read-line in)))
(if (eof-object? line) (if (eof-object? line)
nothing (begin (close-input-port in) nothing)
(each line (each line sep
(fn () (lp)))))))))) (fn () (lp))))))))))
(define (line-numbers . o) (define (line-numbers . o)