Smatchcube's website 🌍


Exercise 3.12

The evalutation of:

can be represented in the following box-and-pointer diagram:

It’s clear that (cdr x) returns (b).

After (define w (append! x y)) the box-and-pointer diagram is:

It’s simple to see that (cdr x) returns (b c d) as the list x has been mutated with the append! procedure.