Warning: This is the manual of the legacy Guile 2.0 series. You may want to read the manual of the current stable series instead.
Next: R6RS Output Ports, Previous: R6RS Binary Input, Up: R6RS I/O Ports [Contents][Index]
Reads from textual-input-port, blocking as necessary, until a complete character is available from textual-input-port, or until an end of file is reached.
If a complete character is available before the next end of file,
get-char
returns that character and updates the input port to
point past the character. If an end of file is reached before any
character is read, get-char
returns the end-of-file object.
The lookahead-char
procedure is like get-char
, but it does
not update textual-input-port to point past the character.
count must be an exact, non-negative integer object, representing the number of characters to be read.
The get-string-n
procedure reads from textual-input-port,
blocking as necessary, until count characters are available, or
until an end of file is reached.
If count characters are available before end of file,
get-string-n
returns a string consisting of those count
characters. If fewer characters are available before an end of file, but
one or more characters can be read, get-string-n
returns a string
containing those characters. In either case, the input port is updated
to point just past the characters read. If no characters can be read
before an end of file, the end-of-file object is returned.
start and count must be exact, non-negative integer objects, with count representing the number of characters to be read. string must be a string with at least $start + count$ characters.
The get-string-n!
procedure reads from textual-input-port
in the same manner as get-string-n
. If count characters
are available before an end of file, they are written into string
starting at index start, and count is returned. If fewer
characters are available before an end of file, but one or more can be
read, those characters are written into string starting at index
start and the number of characters actually read is returned as an
exact integer object. If no characters can be read before an end of
file, the end-of-file object is returned.
Reads from textual-input-port until an end of file, decoding
characters in the same manner as get-string-n
and
get-string-n!
.
If characters are available before the end of file, a string containing all the characters decoded from that data are returned. If no character precedes the end of file, the end-of-file object is returned.
Reads from textual-input-port up to and including the linefeed
character or end of file, decoding characters in the same manner as
get-string-n
and get-string-n!
.
If a linefeed character is read, a string containing all of the text up to (but not including) the linefeed character is returned, and the port is updated to point just past the linefeed character. If an end of file is encountered before any linefeed character is read, but some characters have been read and decoded as characters, a string containing those characters is returned. If an end of file is encountered before any characters are read, the end-of-file object is returned.
Note: The end-of-line style, if not
none
, will cause all line endings to be read as linefeed characters. See R6RS Transcoders.
Reads an external representation from textual-input-port and returns the
datum it represents. The get-datum
procedure returns the next
datum that can be parsed from the given textual-input-port, updating
textual-input-port to point exactly past the end of the external
representation of the object.
Any interlexeme space (comment or whitespace, see Scheme Syntax) in the input is first skipped. If an end of file occurs after the interlexeme space, the end-of-file object (see R6RS End-of-File) is returned.
If a character inconsistent with an external representation is
encountered in the input, an exception with condition types
&lexical
and &i/o-read
is raised. Also, if the end of
file is encountered after the beginning of an external representation,
but the external representation is incomplete and therefore cannot be
parsed, an exception with condition types &lexical
and
&i/o-read
is raised.
Next: R6RS Output Ports, Previous: R6RS Binary Input, Up: R6RS I/O Ports [Contents][Index]