Cool. A cons pair implemented as a closure. cons(a, b) returns a function closing over a and b, which takes a function as argument, and calls it on a and b.
I've seen object systems done as closures. In most languages, a closure can modify its state, so it's an interesting way to close over that state, in a way that is invisible introspection by any other means but the published interface (or a debugger that understands the closure representation).
re: Solution
I've seen object systems done as closures. In most languages, a closure can modify its state, so it's an interesting way to close over that state, in a way that is invisible introspection by any other means but the published interface (or a debugger that understands the closure representation).