READ-LINE does the job as well as READ-CRLF-IO, so kick CRLF-IO.
This commit is contained in:
parent
92d760a1cd
commit
05b7af0986
|
@ -1,18 +1,15 @@
|
||||||
(define-structure servlet servlet-interface
|
(define-structure servlet servlet-interface
|
||||||
(open scheme-with-scsh
|
(open scheme-with-scsh
|
||||||
servlets
|
servlets)
|
||||||
crlf-io)
|
|
||||||
(begin
|
(begin
|
||||||
(define *data* '())
|
(define *data* '())
|
||||||
|
|
||||||
(define (read-data)
|
(define (read-data)
|
||||||
(let ((news-input (open-input-file "news.txt")))
|
(let ((news-input (open-input-file "news.txt")))
|
||||||
(let loop ((next-line (read-crlf-line news-input)))
|
(do ((next-line (read-line news-input)
|
||||||
(if (eof-object? next-line)
|
(read-line news-input)))
|
||||||
(close news-input)
|
((eof-object? next-line) (close news-input))
|
||||||
(begin
|
(set! *data* (cons next-line *data*)))))
|
||||||
(set! *data* (cons next-line *data*))
|
|
||||||
(loop (read-crlf-line news-input)))))))
|
|
||||||
|
|
||||||
(define (main req)
|
(define (main req)
|
||||||
(if (null? *data*) (read-data))
|
(if (null? *data*) (read-data))
|
||||||
|
|
Loading…
Reference in New Issue