Stream Objects

Each input and output stream is represented by a unique Prolog term, a stream_object. In general, this term is of the form

     '$stream'(X).
     

where X is an integer. In addition, the following terms are used to identify the standard I/O streams:

Stream objects are created by the predicate open/[3,4] ref-iou-sfh-opnand passed as arguments to those predicates that need them. Representation for stream objects to be used in C code is different. Use stream_code/2 to convert from one to the other when appropriate.