3 ms·
18-19 years ago, I didn't switch to Lisp because of macros. I was hooked by the list representation: how cons cells can be treated as immutable to implement li
by kazinator 8y ago
18-19 years ago, I didn't switch to Lisp because of macros.
I was hooked by the list representation: how cons cells can be treated as immutable to implement list operations by always allocating new cells that are garbage collected.
I was hooked by the uniform syntax: good-bye ambiguities requiring associativity and precedence rules.
I was charmed by the empty list being nil which is also Boolean false, and the convenience of (car nil) just returning nil: the resulting code looked slick and elegant to me.
I thought it was great how you can just quote any part of the syntax and you get an expression which gives you that syntax as a piece of literal data.
Eventually I learned about defmacro, too, by which time I was productively using Lisp.
I learned about backquote before macros: wow, how great, I thought: like "foo $bar" string interpolation in the shell but with actual data structure.
I got into Lisp not because of some online hype about macros, but because I happened on a copy of Stuart Shapiro's Common Lisp: An Interactive Approach and worked through that. Now that book can be downloaded in electronic form.
One thing that charmed me was the Common Lisp read-table driven dispatch. Knuth's TeX does something very similar. I imitated Knuth's idea in a macro preprocessor that I wrote in 1999 called mpp; the preprocessor was able to redefine its read syntax by re-assigning the categories of characters. When I discovered that Lisp has a character-categorizing dispatch table as the basis of its scanning, I was really bowled over: it was something I had already liked to the point of having implemented it. (Today, I'm not so hot on read tables any more; my TXR Lisp doesn't have the feature.)