Simplified optional arg handling a bit.
This commit is contained in:
parent
c55ec06130
commit
29c3ebf99a
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue