Aliases: Giving Names to Streams¶
This file defines the main operations on aliases, an alternative name for an open stream.
Aliases are always textual constants (atoms). Aliases are often given at open_52 "open/4", but they may also be given through @ref set_stream_property_50 @"set_stream_property/2". They are given back to the system when the stream is closed.
Aliases allow cleaning up code, by separating name from operation, eg YAP has a loop stream used to run the main top-level, which can be std0 originally but then changed to a pipe, a file, or a memory region. Other important streams are the user streams. Finally, the debugger uses debugger input and output.
predefined stream aliases are:
-
user: special alias, initially refers to all the three standard streams.
-
user_input
: initially refers to the stdandard input stream; -
user_output
: initially refers to the stdandard output stream; -
user_error
: initially refers to the stdandard error stream. Often this is the same device asstderr
-
loop_stream
: refers to the stream for the file or object being current consulted -
debugger_input
: refers to the stream used to send debugger commands, by defaultuser_input
. -
debugger_output
: refers to the stream used to output debugging, by defaultuser_error
. It must always be interactive.