[previous] [up] [next]     [contents]
Next: Extended Exercise: Drawing Simple Up: Compound DataPart 1: Previous: Compound DataPart 1:

Structures

The posn structure is built into DrScheme's teaching languages, including make-posn, posn-x, and posn-y.

When you type

(make-posn 1 2)

in the interaction window, DrScheme replies with
(make-posn 1 2)

DrScheme's reply is the same as your input expression because there is no shorter name for the posn containing 1 and 2.

In contrast, enter

(make-posn (+ 1 2) 4)

and DrScheme replies with
(make-posn 3 4)

In this case, (+ 1 2) can be reduced to the simpler 3. But, as before, there is no simpler name for a posn containing 3 and 4 other than (make-posn 3 4).



PLT