In this chapter we will ignore the exact structure of Pico expressions and values and only use their textual representations as accepted and generated by the read and print components. This textual representation has been chosen to be as close as possible to conventional notation from calculus, taking into account the limitations on text formats imposed by personal computers and pocket calculators.
Central to the evaluation of Pico
programs is the notion of a dictionary. In the schematic below, a
dictionary is represented by a double-entry book-like structure that
can be consulted, modified and extended by the
eval
component.
The dictionary binds values to variables. As before, a value is the result obtained when an expression is evaluated; a variable is a new concept: it is an name that may be used within a Pico-program. It enables us to identify and reference values as they are computed.
Examples of variable names are:
Examples of values as generated by the print component are
The exact syntax of variables or values is not relevant at this point.
A dictionary functions as a kind of memory for a computational process. It is generally used to store values identified by the name they are bound to and to retrieve or even change these values as time evolves.
The various operations on dictionaries
will be formally defined in the course of next chapter.