Adding input-port-open? and output-port-open?.

This commit is contained in:
Alex Shinn 2012-11-01 23:42:33 +09:00
parent 2eecec0a4b
commit 73ea9c4e7a
2 changed files with 5 additions and 1 deletions

View file

@ -35,7 +35,8 @@
modulo negative? newline not null? number->string number? numerator
odd? open-input-bytevector open-input-string open-output-bytevector
open-output-string or output-port? pair? parameterize peek-char
peek-u8 port-open? port? positive? procedure? quasiquote quote
peek-u8 input-port-open? output-port-open? port? positive?
procedure? quasiquote quote
quotient raise raise-continuable rational? rationalize read-bytevector
read-bytevector! read-char read-error? read-line read-u8 real? remainder
reverse round set! set-car! set-cdr! square string string->list

View file

@ -61,6 +61,9 @@
(define flush-output-port flush-output)
(define input-port-open? port-open?)
(define output-port-open? port-open?)
(define (close-port port)
((if (input-port? port) close-input-port close-output-port) port))