Page:Scheme - An interpreter for extended lambda calculus.djvu/10



Now let us consider an alternative solution to the samefringe problem. We believe that this solution is clearer for two reasons:


 * 1) the implementation of   is more clearly iterative;
 * 2) rather than returning an object which will return both the first and the rest of a fringe to a given continuation,   returns an object which will deliver up a component in response to a request for that component.

A much simpler and more probable problem is that of building a pattern matcher with backtracking for segment matches. The matcher presented below is intended for matching single-level list structure patterns against lists of atoms. A pattern is a list containing three types of elements: