Exercises in this lecture              Go to the slide, where this exercise belongs -- Keyboard shortcut: 'u'  

Exercise 1.4
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, which is denoted '().

Try to use a proper list function, such as length, on your structures. Can you make sense of the result?


Solution