peek-char -- r7rs Definition procedure;
Procedure variants:
(() -> (character-or-eof))
character-or-eof;((textual-input-port-eof) -> (eof-object))
textual-input-port-eof;eof-object;((textual-input-port-open) -> (character-or-eof))
textual-input-port-open;character-or-eof;scheme:base -- (scheme base);scheme -- (scheme);(peek-char) (peek-char port)Returns the next character available from the textual input
port, but without updating theportto point to the following character. If no more characters are available, an end-of-file object is returned.Note: The value returned by a call to
peek-charis the same as the value that would have been returned by a call toread-charwith the sameport. The only difference is that the very next call toread-charorpeek-charon thatportwill return the value returned by the preceding call topeek-char. In particular, a call topeek-charon an interactive port will hang waiting for input whenever a call toread-charwould have hung.
The text herein was sourced and adapted as described in the "R7RS attribution of various text snippets" appendix.