I love LISP. I am only afraid that I won't 'get it' since I've been orbiting it for a while, without ever diving in. That's going to change. I tried talking to Matt Curtin (OSU) about working in Lisp, but it doesn't seem to have worked out. Meanwhile I'm making good progress with PCL. And after seeing the Unit Test chapter from PCL, I've decided to bite the bullet and do the Data Mining course with LISP as my secret weapon.
While reading Peter Seibel's book, I was surprised to find I wasn't blanking out (usually happens third-fourth chapter in, I go all glassy eyed) as with the others, notably Graham's ANSI CL. Then I got to the portable pathname library and it started happening. So here I intend to put down a blow-by-blow account of going through PCL, so that if ever I should start to blank, I can rewind the stack, or see what I missed that made it so.
Also at some point I'll fill in the Road To Lisp survey here.
How I came to Lisp: TODO How I found PCL: TODO
Practical Common Lisp, by Peter Seibel
Those details aside, somewhere on c.l.l I saw PCL mentioned, about four months back. Read initial chapter, liked it. Checked in on it twice or thrice, but always just 'skimming'. Finally had an epiphany, started printing out the chapters and carrying 'em around in my backpack. (PDFs didn't print for me, so ugly typography). Read whenever I could, usually before bed. Enormous improvement.
As I wrote earlier on c.l.l, the 'database' chapter really crystallized all my vague notions of Lisp being a great language. I'd read all of Paul Graham's work, and several others besides (Costanza, for one).
Some things I knew vaguely about from language theory and experience, but nothing made it 'click' like that DB chapter. Quick development? Hell yes! Macros saving you busy-working? Clear as day! etcetera, etcetera.
So I seriously embarked on a study. Somehow reading before bed seemed to be working better.
I liked the 'Once and future history' title. Not sure what it reminded me of... Camelot? Liked the reiteration of PG's answer to ESR's language list. I liked the discussion of Lisp as it relates to Perl and Cpp. Not sure what the revised edition adds, the old one was fine by me.
I didn't like the REPL of CLISP etc. when I first worked with it. I think it's because I hadn't understood it well enough. I'd never internalized the idea of SEXPs as evaluatable units and how to navigate the REPL (esp when dropped into Debug, as an erstwhile Cpp programmer I actually used to wish it would just dump core and let me get on with debugging, rather than showing me this confusing interface) and SLIME really helps with this.
Seibel made an invaluable contribution to my going ahead with LISP by dissecting a hands on session with SLIME and explaining (Blammo!) what happens when you cause an error, and how LISP is actually attempting to handle the situation gracefully (see above note on Cpp).
I wasn't even sitting at a REPL (I get more confused that way, multi-tasking between book and keyb), but I followed along just fine. This has a connection with FLOW (see c2.com's wiki) and recently I saw a discussion of Lisp and flow? somewhere.
This database practicum chapter totally blew me away. I like that Seibel puts his money where his mouth is right with the first real chapter (intro and asides aside). This is a frequent complaint of Lisp Cynics (though to be fair, most of them are bleating without bothering to put in a bit of effort to 'get it') and one that he adequately addresses.
If the amazing paucity of code does not convince you, it should at least make you 'Whoa!'.
Now note, for most new to the lang (and to Ruby, Perl etc) it just looks like gobbledygook -- their response is "yeah, sure it's short, but what the hell? I don't understand it, so it's no good to me."
Paul Graham's notes on the power curve of langs is the best writing I've seen on understanding this phenomenon.
Languages need to be learnt. There is no point writing something off just because you don't understand it, or don't take the time to learn it.
Once you get S-expressions, you get Lisp. All of it. All that remains is to read a doc and find out how construct X modifies the sexp's you give it. Conceptually, sexp evaluation is all that you need to understand.
Along the way you realise how so much of the power of the language comes from this sexp manipulation, how transparent it is, what all those people meant by 'writing in the parse tree' (PG) and why they raved about it.
Once you get it, you can never go back. To do so would be wilfully turning away from the truth and in doing so you have broken the hacker ethic. You are (and I have) allowed to temporarily forget, so long as at the back of your mind you remember that 'there is a better way', or that you have yet to find the path (dao dreaming).
After this chapter the next chapter on functions was merely a formalism, tackling the few details of keyword, optional, rest arguments and return values.
As a bonus though, Peter tackles the parens, and mentions that in time, they disappear. Not yet for me, but getting there. For instance I can let my eyes slip over the let, and concentrate on the form below. Yay!
After I get Lisp, I should go back and re-read PG, all of the essays, plus the book. I think I'll understand a lot more than I have so far.
More of what I'd read in ANSI CL, but this time I understood it better. It seemd more logically laid out, and more comprehensive, or approachable. Or was it only because this is my second book on CL?
Just skimmed over it again. Peter's organization is brilliant. Perhaps it is the section headings and the short, simple prose (the lisp bits of course, are the poetry). It really is most well laid out.
I hope the final version doesn't introduce extra formatting and thereby screw up the simplicity.
The last two sections are especially worthwhile, and a lesser book organization might have omitted them in favor of putting them in an 'advanced' chapter.
Fairly easy going. Some confusion with the way he explains closures though, as bindings that stay with a fn definition or some such. I had understood closures perfectly, but this confused me. Perhaps Peter was giving us an 'inside' look, at binding implementations or something, but I had to consciously keep this explanation at bay since it confused the heck out of me. Dunno why though.
Good explanation on dynamic and lexical scoping. Dynamic scope is cool, and using it for globals even cooler. Eliminates such a huge class of Cpp screwups!
The generalized assignment section threw me for a bit. Perhaps it was the intro of hashes too early or something (though I'd read of 'em before). Perhaps it was the verbosity of setf'ing a hash... though that is a Lisp artefact.
Shiftf, Rotatef ... wow. Generalized, super wow. Does Perl have these for general structures? Has 'em for lists, I think.
08 Macros: Defining Your Own (pdf) (source) 09 PRACTICAL: Building a Unit test framework (pdf) (source) 10 Numbers, Characters, and Strings (pdf) (source) 11 Collections (pdf) (source) 12 They Called It LISP for a Reason: List Processing (pdf) (source) 13 Beyond Lists: Other Uses for Conses (pdf) (source) 14 Files and File I/O (pdf) (source) 15 PRACTICAL: A Portable Pathname Library (pdf) (source) 16 Object Reorientation: Generic Functions (pdf) (source) 17 Object Reorientation: Classes (pdf) (source) 18 A Few FORMAT Recipes (pdf) (source) 19 Beyond Exception Handling: Conditions and Restarts (pdf) (source) 20 The Special Operators (pdf) (source) 21 Programming in the Large: Packages and Symbols (pdf) (source) 22 LOOP for Black-Belts (pdf) (source) 23 PRACTICAL: A Spam Filter (pdf) (source