/usr/lib/read-line.scm is in scheme9 2013.11.26-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ; Scheme 9 from Empty Space, Function Library
; By Nils M Holm, 2009
; Placed in the Public Domain
;
; (read-line) ==> string
; (read-line input-port) ==> string
;
; Read a line from an input port. When no INPUT-PORT is specified,
; read the current input port.
;
; Example: (with-input-from-file "lib/read-line.scm" read-line)
; ==> "; Scheme 9 from Empty Space, Function Library"
(define (read-line . port)
(letrec
((collect-chars
(lambda (c s)
(cond ((eof-object? c)
(if (null? s)
c
(list->string (reverse! s))))
((char=? c #\newline)
(list->string (reverse! s)))
(else
(collect-chars (apply read-char port)
(cons c s)))))))
(collect-chars (apply read-char port) '())))
|