previous chapterthe pico pagenext chapter


Using variables

Consider the following transcript, resulting from an interaction with a Pico-machine:

A line preceded by a colon is the actual output from the print component. We can see how the variable pi is computed as an approximation to ¹, and then used to initialise a variable x. Assigning the value 0 to a variable zero fails because zero hasn't been defined yet; the same operation applied to x succeeds. Finally, defining the variable abc fails because the expression to the right of the colon references a non-existent variable xyz. Note that as each of the valid expressions is entered, a value is printed out; the effects on the current dictionary are only noticeable through the availability of new variables as the evaluation proceeds.


previous chapterthe pico pagenext chapter