peek-char

Name

peek-char -- Read a character without consuming it

Type: function

Synopsis

peek-char(, char);

Arguments

input-port

An instance of <input-port>. Default is the current input port

Return Values

char

A character object or the EOF object if the input port is at end of file.

Description

This function is similar to read-char in that it reads one character from the input port given, or from the current input port if no argument is given. However, the character read is not consumed and is returned again by the next call to read-char or to peek-char. If there are no more characters to read from the port then the EOF object is returned.