4. Scheme interpreter
- Add quotes to the following S-expression so that the value of its value is
(cons . 'cons): (cons cons (cons cons (cons cons ()))). Notice that the output form used by the Scheme interpreter is (cons quote cons). Make sure you understand why.
- Add quotes to the following S-expression so that the value of the value of the value is
a: (cons quote (cons (cons quote (cons a ())) ())).
For the eval_lambda_expr problem, I suggest that you read over 4.1.1 on pages 364-368 of the text. The text presents the "Core of the Evaluator" in a more abstract and more complex form than I used. If you can translate the basic idea of each sort of expression evaluation into the eval_lambda_expr form, you should be well prepared.
|