Smatchcube's website 🌍


Exercise 3.14

Box-and-pointer diagram before the call of mystery:

After the evaluation of (define w (mystery v)):

The mystery procedure reverses a list using mutation.

It’s clear that v is printed as (a) and w as (d c b a).