abstract class $OSTREAM
****
A general output stream. A first stab at streams. This abstraction is already useful for routines that might use a file or a string ( a common choice is whether a routine will write to stdout or to a string which may then be printed to a file).
_
Usage:
____write_to_stream(o:_$OUTSTREAM)_is
________o_+_"this_is_a_test";
____end;
____Which_can_be_invoked_using:
_____write_to_stream(FILE::stdout);
_______or_
_____s:_STR_STREAM_:=_#;
_____write_to_stream(s);
_____write_to_stream(s);
_____s.str_then_would_have_two_copies_of_"this_is_a_test"_in_it.


Descendants
FILE STR_STREAM OUT ERR



Public


Features
plus(s: $STR);
**** Append the string "s" to the stream
plus(s: $STR): SAME;
**** Append the string "s" to the stream and return self

The Sather Home Page