Lisp Heap Answer

Lisp Heap Question

Here are answers to the lisp heap questions:
- The value of
nargle:
(dingbat 1456 wombat).
- The value of
fred:
((12 barney tuesday . alice) wimple dingbat 1456 wombat)
The extra dot before alice is present because
the last node of the sublist had a non-nil cdr.
To have an ordinary
list, the last cdr must be nil, as in the
above list.
- After performing:
-
(setq morris (car morris))
-
(setq dilbert (cons (cdr (car fred)) nargle))
-
(setq fred (cdr fred))
The diagram becomes:
- The portions of the heap which have become
garbage are shown in red on the above diagram.