READ-LINE does the job as well as READ-CRLF-IO, so kick CRLF-IO.

This commit is contained in:
interp 2003-01-17 17:40:30 +00:00
parent 92d760a1cd
commit 05b7af0986
1 changed files with 5 additions and 8 deletions

View File

@ -1,18 +1,15 @@
(define-structure servlet servlet-interface
(open scheme-with-scsh
servlets
crlf-io)
servlets)
(begin
(define *data* '())
(define (read-data)
(let ((news-input (open-input-file "news.txt")))
(let loop ((next-line (read-crlf-line news-input)))
(if (eof-object? next-line)
(close news-input)
(begin
(set! *data* (cons next-line *data*))
(loop (read-crlf-line news-input)))))))
(do ((next-line (read-line news-input)
(read-line news-input)))
((eof-object? next-line) (close news-input))
(set! *data* (cons next-line *data*)))))
(define (main req)
(if (null? *data*) (read-data))