For version 0.7.0.
To top.  Up: ..Shapes


Core bindings
•catalog •page •stderr •stdout

Program input and output is probably the most important of the frontiers where the pieceful functional life of a Shapes program is faced with the hardships of the stateful world outside.
Sections:    Graphical output    Text output

Graphical output

These states may be used to define the output of a Shapes program, that is, the graphical result. Note that the result may also be defined by returning with a §Drawable from the program, see ../structure.html for details.
Holds result of single-page programs.
It is an error if the program terminates with both •page and •catalog being non-empty.
Note the conceptual difference between programs that produce many pages of output (and it may happen to be just one), and programs that produce just one piece of graphics; a “book” with just one page is still a book, and hence not something which should be included on a page of another document. If the output is something to be placed on a page of an external document, then there is only one logical page to paint, namely •page.
Most Shapes core states represent various aspects of the changing world outside a Shapes program, and have to be provided in the initial environment since they cannot be spawned deterministically from a hot value. On the other hand, •page (and •catalog) can be replaced by user-defined states, but are provided to make a Shapes program easier to read, as not every user will have to invent its own name for a state with the same purpose.
Holds result of multi-page programs.
It is an error if the program terminates with both •catalog and •page being non-empty.
See also the note at •page.

Text output

These states define a way for Shapes programs to write to the standard output streams.
A wrapper for stdout.
A wrapper for stderr.
Get Shapes at Fast, secure and Free Open Source software downloads