Here is the definition of unparse . We have been using records, but have not yet talked about how they can be implemented. As it turns out, there are numerous valid representations for records in Scheme. In the following discussion, we will point out one possible implementation. One should not, of course, rely on any particular implementation since it might change.
Vectors are a good choice for representing records.
We can see that a lambda record is a vector of length 3 where the first entry is the type, lambda , the second entry is the formal parameter, and the third entry is the body. The function make-leaf takes a number as its parameter and creates a vector, inserting the type information in the first slot. If an object is a leaf, it must be a vector with length 2 where the first object is a type symbol equal to leaf . If an object is a leaf, we can return the number inside it using vector references. A lambda expression is in normal form if no lambda term occurs on the left-hand side of an application.