Home > Articles > Programming

  • Print
  • + Share This
From the author of

Other Paradigms

Lisp wasn't the first language to support object orientation, but it has one of the most comprehensive object systems imaginable. The Common Lisp Object System (CLOS) implements object orientation on top of Lisp. It's not the only way of supporting object orientation with Lisp; the metaprogramming facilities of Lisp have been used to implement pretty much every model of object orientation that you'll find.

One of the interesting features of CLOS is that it supports dispatch based on any of the arguments of a method. In most object-oriented languages, the method is looked up based on its name and the class of the receiver. In CLOS, it can be based on any of the arguments, which makes it very hard to implement CLOS in a way that runs quickly, but it's also very flexible.

Lisp is often called a "functional programming language." This is incorrect—Lisp functions can have side effects, so they're not mathematical functions. It is possible to implement a lot of functional programming patterns in Lisp, however, and Lisp provided a lot of the inspiration for pure functional languages.

If you learn a functional language today, the map and fold operations are among the first things that you'll see. They're given as examples of the power of higher-order functions; they take a list and a function as arguments, and then they apply the function to the values in the list. These operations come from Lisp.

Lisp was also the inspiration for a number of object-oriented languages, most notably Smalltalk and Io. The simplicity of the specification of the first version of Lisp was something that Smalltalk aimed to capture. The entire language was specified in detail in a single paper. Lisp lost this simplicity later; the Common Lisp specification is a very long document, but you can think of most of this stuff as part of the standard library, rather than the language. The core language remains simple, at least conceptually—the implementations are fairly complex.

  • + Share This
  • 🔖 Save To Your Account