Next: , Up: Streams

6.10.1 The Output Stream

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 stdout1.


[1] Try executing it under Blox, where the Transcript is linked to the omonymous window!