Next: Your own stream, Up: Streams
The examples in this book all work because they write
their output to the Transcript stream. Each class implements
the printOn: method, and writes its output to the supplied
stream. The printNl method all objects use is simply to
send the current object a printOn: message whose argument is
Transcript (by default attached to the standard output stream
found in the stdout global). You can invoke the standard output stream
directly:
'Hello, world' printOn: stdout stdout inspect
or you can do the same for the Transcript, which is yet another stream:
'Hello, world' printOn: stdout Transcript inspect
the last inspect statement will show you how the Transcript is
linked to stdout38.