this is just a tiny nitpick but I'm wondering why you didn't use pattern matching? if you just wanted to stay schemey then disregard but you could skip the entire shapes section and the rest of the code would still be terser, e.g.<p><pre><code> ((begin? exp)
`(begin . ,(mapply cc (cdr exp) sc)))
</code></pre>
would become<p><pre><code> [`(begin ,xs ...)
`(begin ,@(mapply cc xs sc))]
</code></pre>
or if you're feeling fancy<p><pre><code> (define cc-sc (curryr cc sc))
[`(begin ,(app cc-sc xs) ...) `(begin ,@xs)]</code></pre>