char-ready? -- r7rs Definition predicate;
char-ready? (from vonuvoli);Procedure variants:
(() -> (boolean))
boolean;((textual-input-port-eof) -> (true))
textual-input-port-eof;true;((textual-input-port-open) -> (boolean))
textual-input-port-open;boolean;scheme:base -- (scheme base);scheme -- (scheme);(char-ready?) (char-ready? port)Returns
#tif a character is ready on the textual inputportand returns#fotherwise. Ifchar-readyreturns#tthen the nextread-charoperation on the givenportis guaranteed not to hang. If theportis at end of file thenchar-ready?returns#t.Rationale: The
char-ready?procedure exists to make it possible for a program to accept characters from interactive ports without getting stuck waiting for input. Any input editors associated with such ports must ensure that characters whose existence has been asserted bychar-ready?cannot be removed from the input. Ifchar-ready?were to return#fat end of file, a port at end of file would be indistinguishable from an interactive port that has no ready characters.
The text herein was sourced and adapted as described in the "R7RS attribution of various text snippets" appendix.