Chapter 10. Scheme

Besides Common Lisp, Scheme is the second major Lisp dialect. It was developed by Gerald Jay Sussman and Guy Steele in 1975. Like Common Lisp, Scheme went through a standardization process which lead to an IEEE and ANSI standard in 1991. Scheme can be seen as a lightweight version of Common Lisp (although this is a little bit misleading, since Common Lisp was defined later and adopted some of Scheme's features). Scheme carries less of the historical burden which lead to some of Common Lisp's less obvious features (or quirks). The main advantages when compared to Common Lisp are a more consistent syntax and the uniform treatment of functions and other values (that is, Scheme is a one cell Lisp implementation). On the other hand, Scheme is lacking the comprehensive standard library of Common Lisp including the object oriented extension CLOS.

The current standard document is the fifth revision of the report on Scheme, or R5RS for short.

10.1. Software and Installation

For this chapter we are using MzScheme on Linux, one of the PLT implementations of Scheme. If you prefer a graphical development environment, you can equivalently use DrScheme, whose Windows version comes with a convenient installer and graphical user interface.

Starting mzscheme takes us to the interactive shell, which we will use to explore the Scheme language.

ahohmann@kermit:~$ mzscheme
Welcome to MzScheme version 204, Copyright (c) 1995-2003 PLT
>

References

The best Scheme book [ABELSON96]> is not a book about Scheme, but an introduction to computer science using Scheme as the language of implementation. In this sense, it is the equivalent to Norvig's AI book [NORVIG92]> which is based on Common Lisp. The language reference is the R5RS (the number 5 standing for the fifth revision) which describes the complete language on less than 50 pages.

Harold Abelson, Gerald Jay Sussman, and Julie Sussman, 0-262-51087-1, MIT press, 1996, Structure and Interpretation of Computer Programs: Second Edition.

Jon Pearce, 0-387-98320-1, Springer-Verlag, 1998, Programming and Meta-Programming in Scheme.

1998, Revised 5 Report on the Algorithmic Language Scheme.