Book Review: Practical Common Lisp

This long anticipated work has become something of a livre celebre in the geek world, acting as signifier of the refreshed popularity of this flexible language after years in obscurity and perhaps also signalling to one major publisher that perhaps its time to call off the veto on producing Lisp-based titles. Hardcore Lispers, with little need for such an introductory text, boast of how many copies they purchased in advance, and Amazon sales ranks are bandied about on a few high profile blogs.

[img_assist|nid=49|title=|desc=|link=url,http://www.amazon.com/Practical-Common-Lisp-Peter-Seibel/dp/1590592395/|align=right|width=111|height=150]

Aside from obvious issues of advocacy, Practical Common Lisp (PCL) well deserves its success which is down in part to a rather uncommon approach both for the language and documentation which covers it. Until now, the Lisp world has sorely lacked a well written introductory text which teaches and expands on Common Lisp from a practical perspective and within a free software environment. And if it's not too much to repeat an already rather cliched phrase from this work, "Practical Common Lisp... isn't that an oxymoron."

Author Peter Siebel, self confessed second generation Lisper, sets out to prove such naysayers wrong with a heavily example-led and exercise driven work which reads as well as any of Paul Graham's seminal works. It's worth mentioning that PCL has long been available online where it has recieved substantial peer review and has thus evolved in the public eye. The result is a more or less perfect work on programming, and the pitch is excellent.

The short "hello, world" example which opens the work could well be seen as a bowing to a well established hacker tradition, but it also serves to steer the newbie through the often hairy REPL, otherwise known as the Lisp listener or top-level. The semi-interpreted nature of Lisp and SLIME debugger are also well introduced here. The rather gentle handholding of such early chapters thankfully doesn't last so long before the reader is plunged very much into the deep end with a decent CD database app which even dares to throw in macros. Such an approach is excellent. Rather than spelling out the details of functions, variables and syntax before getting down to work, Seibel walks through a practical app and thus provides an excellent overview of the language's features and common coding idioms.

Of course syntax, functions, data collections, special operators and the like are later covered in exquisite detail, but the fantastic practical examples give the would be Lisper confidence and allow for what could be called learning within the code. We need to know the fine details for sure, but it's great to get a real feeling for the code and that's what the plentiful practical exercises accomplish whilst forging ahead into brave new territory.

Such exercises also function as both useful projects in their won right and as functional expositions of key concepts. The test fraemwork example wonderfully highlights both when and how to use macros. Another project, implementing a portable pathname library, furnishes useful code, functions as working demonstration of Common Lisp portability issues and also runs through common file and directory oriented functions. The emphasis is on practical programming tasks and issues and material on packaging and binary files is particularly useful and little covered, if at all, elsewhere.

Practical examples abound towards the end of the work with nine full heavy hitting projects outlining common idioms. It's good to see a spam filter exercise in evidence as well as an unusual Shoutcast server, but many of the examples are quite workaday with an emphasis on database apps and parsing. Material which deals with Common Lisp's object system are also rather dry. However, the closing chapters which make use of a language-oriented programming model for HTML generation more than make up for a few more personal gripes and do push this work into essential territory which hasn't been explored in such depth print since Sussman or Graham last published.
[img_assist|nid=49|title=|desc=|link=url,http://www.amazon.com/Practical-Common-Lisp-Peter-Seibel/dp/1590592395/|align=left|width=111|height=150]
Author: Peter Seibel
Publisher: Apress
ISBN: 1590592395

Review by Martin Howse



Back to top