mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-22 07:09:18 +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))
|
||||
"\n"))))))
|
||||
|
||||
(define (from-file path)
|
||||
(fn ()
|
||||
(call-with-input-file path
|
||||
(lambda (in)
|
||||
(define (from-file path . ls)
|
||||
(let-optionals* ls ((sep nl))
|
||||
(fn ()
|
||||
(let ((in (open-input-file path)))
|
||||
(let lp ()
|
||||
(let ((line (read-line in)))
|
||||
(if (eof-object? line)
|
||||
nothing
|
||||
(each line
|
||||
(begin (close-input-port in) nothing)
|
||||
(each line sep
|
||||
(fn () (lp))))))))))
|
||||
|
||||
(define (line-numbers . o)
|
||||
|
|
Loading…
Add table
Reference in a new issue