Next: , Up: Scheme   [Contents][Index]


18.1 What are some differences between Scheme and Common Lisp?

Scheme is a dialect of Lisp that stresses conceptual elegance and simplicity. It is much smaller than Common Lisp; the language specification is about 50 pages, compared to Common Lisp’s 1300 page draft standard. Advocates of Scheme often find it amusing that the entire Scheme standard is shorter than the index to Guy Steele’s "Common Lisp: the Language, 2nd Edition". Unlike the Scheme standard, the Common Lisp standard has a large library of utility functions, a standard object-oriented programming facility (CLOS), and a sophisticated condition handling system.

"Some people prefer to teach Scheme in introductory courses because it is so much smaller than Common Lisp. But one can easily teach the subset of Common Lisp that is equivalent to Scheme, so language size isn’t really an issue for beginners. A more compelling argument is that there is a certain style of applicative programming, making heavy use of lexical closures, that can be expressed more elegantly in Scheme syntax. But there are also areas where Common Lisp is superior to Scheme, such as its support for user defined macros, its elegant unification of lists and vectors into a sequence datatype, and its use of keyword arguments to greatly extend the utility of the sequence functions. The combination of tremendous power, extensive manufacturer support, and a built-in object-oriented programming facility make Common Lisp the only industrial strength Lisp. Although this book24 does emphasize a side-effect-free, applicative approach to programming with which Scheme afficionados will feel quite at home, it does so in purely Common Lisp style."

Namespaces

In Common Lisp a symbol can name both an operator—function, macro, or special operator—and a variable. This is one of the major differences between Common Lisp and Scheme. The difference is sometimes described as Common Lisp being a Lisp-2 vs. Scheme being a Lisp-1—a Lisp-2 has two namespaces, one for operators and one for variables, but a Lisp-1 uses a single namespace. Both choices have advantages, and partisans can debate endlessly which is better.

Peter Seibel in Practical Common Lisp

The False Value

Not all Lisps handle boolean values the same way. Another of the many subtle differences upon which a good Common Lisp vs. Scheme flame war can rage for days is Scheme’s use of a distinct false value ‘#f’, which isn’t the same value as either the symbol ‘nil’ or the empty list, which are also distinct from each other.

Peter Seibel in Practical Common Lisp

Footnotes

(24)

In the browser, add ‘index.text’ to the end of the URL to see the source.


Next: Standardizations of Scheme, Up: Scheme   [Contents][Index]