mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-08 05:27:35 +02:00
Fixed from-file so that it produces more than just one line of output.
This commit is contained in:
parent
d0b63109e8
commit
ece2d470c3
1 changed files with 6 additions and 6 deletions
|
@ -464,15 +464,15 @@
|
||||||
cons))
|
cons))
|
||||||
"\n"))))))
|
"\n"))))))
|
||||||
|
|
||||||
(define (from-file path)
|
(define (from-file path . ls)
|
||||||
(fn ()
|
(let-optionals* ls ((sep nl))
|
||||||
(call-with-input-file path
|
(fn ()
|
||||||
(lambda (in)
|
(let ((in (open-input-file path)))
|
||||||
(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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue