minor fixes
svn: r16473
This commit is contained in:
parent
52ac79406b
commit
c049ccca3a
|
@ -475,29 +475,20 @@
|
||||||
void))))
|
void))))
|
||||||
|
|
||||||
(define in-port
|
(define in-port
|
||||||
(let ([mk (lambda (p r)
|
(case-lambda
|
||||||
|
[() (in-port (current-input-port) read)]
|
||||||
|
[(r) (in-port (current-input-port) r)]
|
||||||
|
[(r p)
|
||||||
|
(unless (and (procedure? r) (procedure-arity-includes? r 1))
|
||||||
|
(raise-type-error 'in-port "procedure (arity 1)" r))
|
||||||
|
(unless (input-port? p) (raise-type-error 'in-port "input-port" p))
|
||||||
(make-do-sequence
|
(make-do-sequence
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(values r values p void
|
(values r values p void
|
||||||
(lambda (x) (not (eof-object? x)))
|
(lambda (x) (not (eof-object? x)))
|
||||||
void))))])
|
void)))]))
|
||||||
(case-lambda
|
|
||||||
[() (mk (current-input-port) read)]
|
|
||||||
[(r) (mk (current-input-port) r)]
|
|
||||||
[(r p)
|
|
||||||
(unless (and (procedure? r) (procedure-arity-includes? r 1))
|
|
||||||
(raise-type-error 'in->port "procedure (arity 1)" r))
|
|
||||||
(unless (input-port? p) (raise-type-error 'in-port "input-port" p))
|
|
||||||
(mk p r)])))
|
|
||||||
|
|
||||||
(define in-lines
|
(define in-lines
|
||||||
(let ([mk (lambda (p m)
|
|
||||||
(make-do-sequence
|
|
||||||
(lambda ()
|
|
||||||
(values (lambda (p) (read-line p m))
|
|
||||||
values p void
|
|
||||||
(lambda (x) (not (eof-object? x)))
|
|
||||||
void))))])
|
|
||||||
(case-lambda
|
(case-lambda
|
||||||
[() (in-lines (current-input-port) 'any)]
|
[() (in-lines (current-input-port) 'any)]
|
||||||
[(p) (in-lines p 'any)]
|
[(p) (in-lines p 'any)]
|
||||||
|
@ -508,7 +499,12 @@
|
||||||
'in-lines
|
'in-lines
|
||||||
"'linefeed, 'return, 'return-linefeed, 'any, or 'any-one"
|
"'linefeed, 'return, 'return-linefeed, 'any, or 'any-one"
|
||||||
mode))
|
mode))
|
||||||
(mk p mode)])))
|
(make-do-sequence
|
||||||
|
(lambda ()
|
||||||
|
(values (lambda (p) (read-line p m))
|
||||||
|
values p void
|
||||||
|
(lambda (x) (not (eof-object? x)))
|
||||||
|
void)))]))
|
||||||
|
|
||||||
(define (in-hash ht)
|
(define (in-hash ht)
|
||||||
(unless (hash? ht) (raise-type-error 'in-hash "hash" ht))
|
(unless (hash? ht) (raise-type-error 'in-hash "hash" ht))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user