##
Writing Objects to a Channel

The process of saving Objects is very straightforward. You can simply write any ObjectObject to a ChannelChannel using the astWriteastWrite function, as follows:

228#228

The effect of this will be to produce a textual description of the Object which will appear, by default, on your program's standard output stream. Any class of Object may be converted into text in this way.

astWrite returns a count of the number of Objects written. Usually, this will be one, unless the Object supplied cannot be represented. With a basic Channel all Objects can be represented, so a value of one will always be returned unless there has been an error. We will see later, however, that more specialised forms of Channel may impose restrictions on the kind of Object you can write (§17.2). In such cases, astWrite may return zero to indicate that the Object was not acceptable.