Writing Programs for "The Book" > Warning to Parenthophobes

33.2. Warning to Parenthophobes

I present the code in Lisp. I'm not going to apologize for my choice of programming language, but neither do I want to turn this chapter into a tract for recruiting Lisp converts. I'll just say that I believe multilingualism is a good thing. If reading the code snippets below teaches you something about an unfamiliar language, the experience will do you no harm. All of the procedures are very short—half a dozen lines or so. Figure 33-1 offers a thumbnail guide to the structure of a Lisp procedure.

Incidentally, the algorithm implemented by the program in the figure is surely in The Book. It is Euclid's algorithm for calculating the greatest common divisor of two numbers.

Figure 33-1. Bits and pieces of a Lisp procedure definition