Summary: | Separating a programming language into side-effect-free expressions and effect-only statements should make the language more amenable to axiomatization, as well as providing benefits for style, pedagogy, and implementation efficiency (particularly in parallel-computing environments). This paper shows that such a division does not come at an unreasonable cost in programming convenience. First a dialect of Lisp is defined, in which a distinction is made between statements, which may have side-effects, and expressions, which may not. Next, a representative collection of examples from Abelson and Sussman's Structure and Interpretation of Computer Programs is coded in this dialect of Lisp. Most of the examples divide neatly into functional and imperative portions, and a few relatively clean transformations prove sufficient for the more stubborn cases.
|