Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Practical Common Lisp is intro + recipes.

I think Paul Grahams ANSI Common Lisp is the best if you are learning Common Lisp and Lisp. The language reference in the end is the extremely handy compact reference for CL. http://www.paulgraham.com/acl.html

Common Lisp Recipes is better as a pure recipe book. http://weitz.de/cl-recipes/



> I think Paul Grahams ANSI Common Lisp is the best if you are learning Common Lisp and Lisp.

I disagree, and here's why:

Practical Common Lisp is the SINGLE Lisp reference I have ever found that talks about how to use real data structures instead of stupid cons pairs.

That's really, really huge. And it's probably why so many people actively dislike Lisp. And it's probably why Clojure achieved such popularity.


While I understand the need to use other data structures (and even in Lisp, I would not use cons pairs for everything), I think "stupid cons pairs" is pretty extreme.

If you don't understand why cons is important, and the appropriate places to use it, then you really don't understand Lisp.


> If you don't understand why cons is important, and the appropriate places to use it, then you really don't understand Lisp.

Lisp-the-mathematical-model, perhaps, but not Lisp-the-programming-language.

Conses are definitely a fundamental idea, and they're obviously how source code is written, and it's nice that they're around — but honestly for real work it's unlikely that most data will live in cons structures (unless of course the higher-level data structures actually are built from conses, which of course they could be).


At what point did I say "most data will live in cons structures"? And I explicitly said I would not use them for everything. And no, it isn't just "Lisp-the-mathematical-model", cons cells have real-world implications to the language.

I was going to suggest watching the video presentation "The Swine Before Perl", by Shriram Krishnamurthi, but alas I can't find a link to the video (which is sad, because it is a very entertaining and informative video). The slides are here: ( http://ll1.ai.mit.edu/shriram-talk.pdf ), but without the talk they may do you no good.

Hopefully someone will see this and add a link to the video ( it should be made available again, even after all of this time, it is still great -- I believe I saw it as recently as 2 years ago).


>SINGLE Lisp reference I have ever found

Then you haven't read many Lisp books, including Common Lisp Recipes and ANSI Common Lisp. There are so many of good ones.


This is my pet peeve you are arguing into. Beware. :)

Here's my point: People can build amazing programs with just Vectors or Hashes. People can build amazing programs without understanding recursion, evaluation, macros, or metalinguistic abstraction. And, in fact, before memory became cheap (roughly 1995) recursion was a negative, not a positive.

So, guess which things Lisp taught and which it didn't? Yeah, they got it precisely BACKWARDS and then wondered why Lisp wasn't more popular.

Go back, and look at Lisp books prior to the web--call it 1995-1996.

I 1987, I had a version of Touretzky's "Common LISP: A Gentle Introduction to Symbolic Computation". I do not remember any discussion of Hashes, Vectors, etc., but I see that even the 1990 version confines them to the next to the last chapter and the discussion qualifies as cursory, at best.

SICP doesn't even mention it. Nor does Little Schemer (nee Little Lisper).

"On Lisp" (1993) just drops hashes and vectors in your lap as it expects you to already know about them. "ANSI Common Lisp" by Graham doesn't appear until 1995.

CLtL and R4RS are references. You sure aren't going to learn Lisp/Scheme from those.

Sure, once Perl taught the universe how useful hash tables were, everybody started going "Hey, we have those too...", but prior to that is a big hole.


>People can build amazing programs with just Vectors or Hashes. People can build amazing programs without understanding recursion, evaluation, macros, or metalinguistic abstraction.

That's what Common Lisp provided back in 1984. Basic data structures like strings, characters, vectors, various numbers, I/O streams, records and hashes. It offer a lot of Lisp-stuff additionally, but it had everything to write plain programs.

> recursion was a negative, not a positive

That's why real-world Common Lisp usually avoided recursion early on and Common Lisp has lots of non-recursive iteration facilities. Scheme made some forms of recursion 'cheap' by introducing tail call optimisation (TCO) - which often is provided by Common Lisp implementations, too. But TCO was not standardised because it was difficult to integrate it with the rest of the language back then.

> I do not remember any discussion of Hashes, Vectors, etc.,

There were some books with more interesting examples, like the then popular LISP from Winston/Horn, where the 3rd edition from 1989 was fully moved to Common Lisp.

For key-value data structures Lisp traditionally used property lists, association lists and forms of search trees. Later some forms of object systems, which also map keys to values - like Frame systems. Larger Lisp systems used hash arrays (Interlisp) or hash tables (Common Lisp). Hash-tables were indeed not that often topic in the literature.

> CLtL and R4RS are references

The CLtL1 was quite good for learning Common Lisp. It's an nicely readable book and not the dense R4RS. CLtL2 made thinks difficult, because it was presenting the then defined ANSI CL (before it was actually finished) and all the deltas to the older CLtL1.


Perl cribbed associative arrays directly from Awk, contributing to them some ugly sigils.


> including Common Lisp Recipes

To be fair, that's a 2016 book. Pretty awesome though, I have to say - I'd highly recommend it for anyone who knows a bit of Common Lisp (e.g. after PCL). It's basically the "Effective C++" of Lisp world.


I love that book.


Another, more easily accessible, quick reference: http://clqr.boundp.org

I made a paper copy a while back, as is recommended by the authors. It's come in a lot of handy.


Slightly disagree with this....pg's work is the manual, though peter's examples and explanation of the concepts in lisp are practical to the core. To the point that you re-use your own code developed in the earlier chapters into the later chapters. That was the deal breaker, at least for me. Learning a new programming language is often bland, though engaging the reader practically isn't actually easy as it may seem.


For me, during the university ANSI Common Lisp was the Kernighan & Ritchie of Lisp - a standalone physical source of everything that I needed to start doing interesting things. Since then I haven't found another "canonical book" for another language that I jumped on, instead relying basically on internet. On that line, I loved "The haskell school of expression", though!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: