EIO Builtin Predicate Set

In the examples below, assume the database contains

?- dynamic(test/1).
?- public(test/2).

test(1).
test(1).	% Note that this is defined twice
test(2) :- atom(a).
test(3).

test(a, b).
test(a, c).

Also, assume that the standard input stream will yield the following when read (where <space> stands for a single space).

<space>a(b, C).
/* This is a comment */ abc.

Also, assume that there exists a text input stream with alias textin and a text output stream with alias textout. Assume that the the first line of textin contains

<space>x(y, Z).

 

display / 2
Prototype: display(StreamOrAlias, Term)
(Same as ISO write_canonical/2) Writes Term to the stream / stream having alias StreamOrAlias, without using operator or list notation. Atoms that would need to be quoted to be accepted by read are quoted.
Example: display(textout, [2 + 2]) - writes '.'(+(2, 2), []) to textout.
 
get / 2
Prototype: get(StreamOrAlias, Code)
Reads the first non-whitespace character from the stream / stream having alias StreamOrAlias - skipping over whitespace - and unifies its code with Code. End of file is represented by a code of -1.
Example: get(textin, C) - instantiates C to 47 (the code for /).
 
get0 / 2
Prototype: get0(StreamOrAlias, Code)
(Same as ISO get_code/2) Reads the first character - including whitespace - from the stream / stream having alias StreamOrAlias and unifies its code with Code. End of file is represented by a code of -1.
Example: get0(textin, C) - instantiates C to 32 (the code for space).
 
listing / 2
Prototype: listing(StreamOrAlias, PredicateNameOrIndicator)
Writes a listing of all clauses for the specified public predicate, or all public predicates for the specified functor, to the stream / stream having alias StreamOrAlias
Example: listing(textout, test/1) - lists the four clauses for test/1 to textout.
Example: listing(textout, test) - lists the four clauses for test/1 and the two clauses for test/2 to textout.
 
put / 2
Prototype: put(StreamOrAlias, Code)
(Same as ISO put_code/2) Writes the character whose ASCII code is Code to the stream / stream having alias StreamOrAlias.
Example: put(textout, 65) - writes A to textout.
 
skip / 2
Prototype: skip(StreamOrAlias, Code)
Skips forward in the stream / stream having alias StreamOrAlias until a character with code Code is read. The next get type operation will get the character just after this one. End of file is represented by a code of -1.
Example: skip(textin, 48) - skips forward in textin until just after the '(', so the next character read in the example stream would be 'x'.
 
tab / 2
Prototype: tab(StreamOrAlias, Amount)
Writes Amount spaces to the stream / stream having alias StreamOrAlias.
Example: tab(textout, 3) - writes three spaces to textout.