Added close-port. Updated user's guide's list of unsupported

primitives.
This commit is contained in:
Abdulaziz Ghuloum 2007-11-23 03:44:48 -05:00
parent ccce44fffa
commit 5e7451167d
7 changed files with 38 additions and 35 deletions

Binary file not shown.

View File

@ -1812,13 +1812,12 @@ missing features and procedures.
-- Procedures that may construct complex numbers from non-complex
arguments may signal an error or return an incorrect value
(for example, \texttt{(sqrt -1)} should \emph{not} be \texttt{+nan.0}).
\item Reader does not recognize \texttt{\#!r6rs} syntax. It should
be modified to accept both \texttt{\#!r6rs} and \texttt{\#!ikarus}
so that Ikarus-specific reader features (gensym syntax, record
syntax, shared graphs, fasl objects, etc.) can be enabled/disabled as needed.
\item The procedure \texttt{equal?}\ may not terminate on
\texttt{equal?}\ infinite (circular) input.
\item Representation of I/O ports is missing a transcoder field.
\item \texttt{number->string} does not accept the third argument
(precision). Similarly, \texttt{string->number} and the reader do
not recognize the \texttt{|p} notation.
\end{itemize}
\newpage
\section{List of missing \rnrs{6} procedures}
@ -1836,18 +1835,18 @@ string->utf16 string->utf32 utf16->string utf32->string
The following procedures are missing from \texttt{(rnrs unicode)}:
\begin{Verbatim}
string-downcase string-foldcase string-titlecase string-upcase
string-normalize-nfc string-normalize-nfd
string-normalize-nfkc string-normalize-nfkd
string-downcase string-titlecase string-upcase
string-normalize-nfc string-normalize-nfd
string-normalize-nfkc string-normalize-nfkd
\end{Verbatim}
The following procedures are missing from \texttt{(rnrs arithmetic
bitwise)}:
\begin{Verbatim}
bitwise-ior bitwise-xor bitwise-if bitwise-bit-field
bitwise-copy-bit-field bitwise-bit-set? bitwise-copy-bit
bitwise-reverse-bit-field bitwise-rotate-bit-field bitwise-length
bitwise-ior bitwise-xor bitwise-if bitwise-bit-field
bitwise-copy-bit-field bitwise-copy-bit bitwise-length
bitwise-reverse-bit-field bitwise-rotate-bit-field
\end{Verbatim}
@ -1860,32 +1859,26 @@ fxreverse-bit-field fxrotate-bit-field
The following procedures are missing from \texttt{(rnrs hashtables)}:
\begin{Verbatim}
make-eqv-hashtable make-hashtable
make-eqv-hashtable make-hashtable equal-hash
hashtable-hash-function hashtable-equivalence-function
equal-hash string-hash string-ci-hash symbol-hash
\end{Verbatim}
The following procedures are missing from \texttt{(rnrs io ports)}:
\begin{Verbatim}
call-with-bytevector-output-port call-with-string-output-port
binary-port? textual-port? port-eof?
port-has-port-position? port-position
port-has-set-port-position!? set-port-position!
call-with-port close-port
get-bytevector-all get-bytevector-some
get-bytevector-n get-bytevector-n!
lookahead-char lookahead-u8
get-string-all get-string-n get-string-n! put-string
call-with-bytevector-output-port call-with-string-output-port
binary-port? textual-port? port-eof?
port-has-port-position? port-position
port-has-set-port-position!? set-port-position!
call-with-port lookahead-char lookahead-u8
get-bytevector-all get-bytevector-some get-string-all
make-custom-binary-input-port make-custom-binary-input/output-port
make-custom-binary-output-port make-custom-textual-input-port
make-custom-textual-input/output-port make-custom-textual-output-port
open-bytevector-input-port open-bytevector-output-port
open-file-input-port open-file-input/output-port open-file-output-port
output-port-buffer-mode
transcoded-port port-transcoderput-bytevector
standard-error-port standard-input-port standard-output-port
output-port-buffer-mode transcoded-port port-transcoderput-bytevector
string->bytevector bytevector->string
\end{Verbatim}

View File

@ -21,7 +21,7 @@
get-string-n get-string-n!
get-bytevector-n get-bytevector-n!
newline port-name input-port-name output-port-name
close-input-port reset-input-port!
close-input-port reset-input-port! close-port
flush-output-port close-output-port get-line)
(import
(ikarus system $io)
@ -34,7 +34,7 @@
get-bytevector-n get-bytevector-n!
newline port-name input-port-name output-port-name
close-input-port reset-input-port! flush-output-port
close-output-port get-line))
close-output-port close-port get-line))
(define write-char
(case-lambda
@ -172,6 +172,13 @@
($close-output-port p)
(error 'close-output-port "not an output-port" p))]))
;;;
(define (close-port p)
(cond
[(input-port? p) ($close-input-port p)]
[(output-port? p) ($close-output-port p)]
[else (error 'close-port "not a port" p)]))
;;;
(define flush-output-port
(case-lambda
[() ($flush-output-port (current-output-port))]

View File

@ -16,7 +16,7 @@
(library (ikarus io input-files)
(export open-input-file current-input-port console-input-port
with-input-from-file call-with-input-file)
standard-input-port with-input-from-file call-with-input-file)
(import
(ikarus system $ports)
(ikarus system $io)
@ -28,7 +28,7 @@
(except (ikarus)
open-input-file current-input-port console-input-port
with-input-from-file call-with-input-file
*standard-input-port* *current-input-port*))
standard-input-port current-input-port))
(define-syntax message-case
(syntax-rules (else)
@ -256,6 +256,9 @@
(define console-input-port
(lambda () *standard-input-port*))
(define standard-input-port
(lambda () *standard-input-port*))
(define current-input-port
(case-lambda
[() *current-input-port*]

View File

@ -1 +1 @@
1118
1119

View File

@ -1052,7 +1052,7 @@
[null-environment i r5 se]
[quotient i r r5 se]
[scheme-report-environment r5 se]
[close-port r ip]
[close-port i r ip]
[eol-style i r ip]
[error-handling-mode i r ip]
[file-options i r ip]

View File

@ -558,7 +558,7 @@
[quotient C r5 se]
[scheme-report-environment C r5 se]
;;;
[close-port S ip]
[close-port C ip]
[eol-style C ip]
[error-handling-mode C ip]
[file-options C ip]
@ -646,9 +646,9 @@
[put-string C ip]
[put-u8 C ip]
[set-port-position! S ip]
[standard-error-port S ip]
[standard-input-port S ip]
[standard-output-port S ip]
[standard-error-port C ip]
[standard-input-port C ip]
[standard-output-port C ip]
[string->bytevector S ip]
[textual-port? S ip]
[transcoded-port S ip]
@ -778,7 +778,7 @@
[string-ci>=? C uc se]
[string-ci>? C uc se]
[string-downcase S uc]
[string-foldcase S uc]
[string-foldcase C uc]
[string-normalize-nfc S uc]
[string-normalize-nfd S uc]
[string-normalize-nfkc S uc]