views:

635

answers:

6

I've learned enough Common Lisp to be able to muddle my way through writing an application. I've read Seibel's Practical Common Lisp

What libraries or programs should I be reading to understand the idioms, the Tao, of Common Lisp?

+17  A: 

CL-PPCRE is often cited as a good example, for good reason. Actually, probably any of Edi Weitz's libraries will make good reading, but CL-PPCRE is particularly clever and it's a useful and impressive library. Beyond that a lot of CL implementations are written mostly in CL. It can be pretty productive to pick some part of CL that's usually implemented in CL and compare how different implementations handle it. In particular, some of the best examples of large useful macro systems are implementations of things in the standard. Loop is an interesting read, or if you're really ambitious you could compare a few implementations of CLOS.

If there's some area of computing you are particularly interested in it might be worth mentioning that, so people can tailor recommendations to that.

T Duncan Smith
[Sacla](http://homepage1.nifty.com/bmonkey/lisp/sacla/index-en.html) implements a sizable chunk of Common Lisp in Common Lisp, so it would be a good example of what you suggest.
jmbr
+14  A: 

It's another book, so it may not be precisely what you're looking for, but Peter Norvig's Paradigms in Artificial Intelligence Programming contains a lot of well-written, smallish Common Lisp programs. It's not perfectly natural code, especially in the the first few chapters, because, like code in Practical Common Lisp, it focuses on teaching you how to program in CL, but it's still very much worth a read. It also contains some very nice examples of ways you can build other languages on top of Common Lisp, and it has some very valuable advice on how to improve the performance of CL programs.

Pillsy
That's an excellent recommendation. The code in the book is generally very good, but Norvig explains more and more how to write better code from chapter to chapter. He does start with basic versions and then shows how to improve it.
Rainer Joswig
I'd definitely second this. PAIP is one of my favorite books about programming, though the name is a bit misleading, IMHO. One thing I would say about it is that the style seems a bit "old-fashioned" or academic to me. That's not a criticism though- it seems to me that the fashionable CL idiom has changed a bit in the last 10-15 years, but there's nothing wrong with code that doesn't follow the fashion.
T Duncan Smith
+7  A: 

The other recommendations (PAIP and CL-PPCRE) are excellent. I would also suggest becoming acquainted with Alexandria's code and also taking a look at GBBopen.

jmbr
I'd never heard of GBBopen - thanks for the link!
Frank Shearar
+1  A: 

I like the SBCL code.

skypher
+1  A: 

The only thing I would offer is to program. That is what I did.

I did two things. One I tackled a problem that i was familiar with, a unit testing framework and expanded it to include test suites. To get an understanding of macro writing.

The second thing I did was play around with basic objects in CL. Macros, closures, and style.

Also don't forget about getting feedback from Lispers about your code.

(defun ugly-lisp-code? () ())

Gutzofter
You're absolutely right that you need to actually program to develop proficiency. However, like with authors (and you touch on this), we sometimes need to see what "good" means so we can emulate it.
Frank Shearar
Its more than doing it 'good', though. Try the shift from imperative to declarative "GOOD".
Gutzofter
+2  A: 

The Art of the Metaobject Protocol - is a book with the most beautiful code ever written.

Flinkman