next up previous index
Next: The Mode Analyser Up: Libraries Previous: Syntax differences

I/O Redirection

 

This library is loaded with

    :- lib(fromonto).
and defines several primitives that allow to easily redirect the standard user input or output from or to a given file, stream or string. The available primitives are All input (output) in Goal is taken from (to) the specified medium. Example:
[eclipse 1]: write(hello) onto_file scratch.

yes.
[eclipse 2]: read(X) from_file scratch.

X = hello
yes.
[eclipse 3]: read(X) from_string "s(a,2,[3])".

X = s(a, 2, [3])
yes.
[eclipse 4]: (write(hello), put(0' ), write(world)) onto_string S.

S = "hello world"
yes.



Micha Meier
Mon Mar 4 12:11:45 MET 1996