Examples of excellent Common Lisp code?

LispCommon Lisp

Lisp Problem Overview


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?

Lisp Solutions


Solution 1 - Lisp

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.

Solution 2 - Lisp

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 excellent examples of ways you can build other languages on top of Common Lisp, and it has some valuable advice on how to improve the performance of CL programs.

Solution 3 - Lisp

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.

Solution 4 - Lisp

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

Solution 5 - Lisp

LISP (Lisp In Small Pieces) is a neat book; shows clossette (small obect system) and some compiler stuff. Without doubt, Norvig's book is awesome.

I really like "Building Problem Solvers" as well but the code is a bit rough. I'm not used to binding dynamic-scoped variables in the parameter list. But it made for much fun improvements trying to "pre-compile" the discrimination net. This book gives another approaches to some of Norvig's code; I still think that Norvig's code is much "neater and cleaner" code (easier to read and understand, and still creative).

"Building Problem Solvers" should come with a warning label like "you're gonna need some aspiren (sp). It felt like a bolt of lightning struck me in the head when I finally "understood" rms and Sussmans' dependency directed backtracking. Compiling the pdis was also brilliant. Excellent stuff. I just wish I could remember it all ...

Solution 6 - Lisp

I like the SBCL code.

Solution 7 - Lisp

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? () ())

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFrank SheararView Question on Stackoverflow
Solution 1 - LispTagore SmithView Answer on Stackoverflow
Solution 2 - LispPillsyView Answer on Stackoverflow
Solution 3 - LispjmbrView Answer on Stackoverflow
Solution 4 - LispFlinkmanSVView Answer on Stackoverflow
Solution 5 - LispsteveView Answer on Stackoverflow
Solution 6 - LispLeslie P. PolzerView Answer on Stackoverflow
Solution 7 - LispGutzofterView Answer on Stackoverflow