In a previous essay series, we saw how to write an expression evaluator that supports arithmetic and logical operators, variables, and functions like IF, MIN, and MAX. In this essay, we’ll implement a similar but slightly more advanced program: an interpreter for a dialect of Lisp called Scheme.1
We’ll start with a brief discussion about Scheme’s syntax and the basic architecture of the interpreter. Then we’ll implement number, boolean, string, and list data types; primitive procedures; conditional expressions; variables; and lambdas.