Simplified optional arg handling a bit.

This commit is contained in:
shivers 1998-05-02 17:13:09 +00:00
parent c55ec06130
commit 29c3ebf99a
1 changed files with 10 additions and 20 deletions

View File

@ -33,16 +33,11 @@
(define (select!/copyback/errno read-vec write-vec
exception-vec . maybe-timeout)
(let ((timeout (and (pair? maybe-timeout)
(if (pair? (cdr maybe-timeout))
(apply error "Too many arguments"
select!/copyback/errno
read-vec write-vec exception-vec
maybe-timeout)
(real->exact-integer (check-arg real?
(car maybe-timeout)
select!/copyback/errno)))))
(let* ((timeout (:optional maybe-timeout #f))
(timeout (and timeout
(real->exact-integer (check-arg real?
timeout
select!/copyback/errno))))
(vec-ok? (lambda (v)
(vector-every? (lambda (elt)
(or (and (integer? elt) (>= elt 0))
@ -95,16 +90,11 @@
(values nr nw ne))))
(define (select!/errno read-vec write-vec exception-vec . maybe-timeout)
(let ((timeout (and (pair? maybe-timeout)
(if (pair? (cdr maybe-timeout))
(apply error "Too many arguments"
select!/copyback/errno
read-vec write-vec exception-vec
maybe-timeout)
(real->exact-integer (check-arg real?
(car maybe-timeout)
select!/copyback/errno)))))
(let* ((timeout (:optional maybe-timeout #f))
(timeout (and timeout
(real->exact-integer (check-arg real?
timeout
select!/copyback/errno))))
(vec-ok? (lambda (v)
(vector-every? (lambda (elt)
(or (and (integer? elt) (>= elt 0))