开发者

Examples of excellent Common Lisp code?

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?


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.


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.


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.


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


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 ...


I like the SBCL code.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜