Adding missing eof-object procedure.

Fixes issue #183.
This commit is contained in:
Alex Shinn 2013-06-25 22:22:01 +09:00
parent 6f1c038989
commit 050b353f34
3 changed files with 4 additions and 1 deletions

View file

@ -21,7 +21,7 @@
close-input-port close-output-port close-port complex? cond cond-expand close-input-port close-output-port close-port complex? cond cond-expand
cons current-error-port current-input-port current-output-port define cons current-error-port current-input-port current-output-port define
define-record-type define-syntax define-values denominator do define-record-type define-syntax define-values denominator do
dynamic-wind else eof-object? eq? equal? eqv? error dynamic-wind else eof-object? eof-object eq? equal? eqv? error
error-object-irritants error-object-message error-object? even? error-object-irritants error-object-message error-object? even?
exact exact-integer-sqrt exact-integer? exact? expt features exact exact-integer-sqrt exact-integer? exact? expt features
file-error? floor file-error? floor

View file

@ -97,6 +97,8 @@
(close-port port) (close-port port)
res)) res))
(define (eof-object) (read-char (open-input-string "")))
(define (read-bytevector n . o) (define (read-bytevector n . o)
(if (zero? n) (if (zero? n)
#u8() #u8()

View file

@ -1526,6 +1526,7 @@
(close-port out) (close-port out)
(output-port-open? out))) (output-port-open? out)))
(test #t (eof-object? (eof-object)))
(test #t (eof-object? (read (open-input-string "")))) (test #t (eof-object? (read (open-input-string ""))))
(test #t (char-ready? (open-input-string "42"))) (test #t (char-ready? (open-input-string "42")))
(test 42 (read (open-input-string " 42 "))) (test 42 (read (open-input-string " 42 ")))