MC logo

Lisp Heap Answer


Lisp Heap Question

Here are answers to the lisp heap questions:
  1. The value of nargle: (dingbat 1456 wombat).

  2. 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.

  3. After performing: The diagram becomes:

  4. The portions of the heap which have become garbage are shown in red on the above diagram.