Exercises in this lecture               Go to the notes, in which this exercise belongs -- Keyboard shortcut: 'u'   Alphabetic index   Course home      

Exercise 2.3
Construction of symbolic expressions *


Construct the symbolic expressions illustrated on this page via the cons primitive in Scheme. The entities named a through h should be symbols. As a help, the rightmost part of the structure is made by (cons 'g 'h). 'g is equivalent to (quote g), meaning that g is not evaluated, but taken for face value.

Experiment with h being the empty list. Try to use a proper list function, such as length, on your structures.


Solution