The real challenge is knowing what to write, not how to write it.
Yeah, this is the difficult thing for me. I’ve written extensions of basic forms like cond. But I haven’t yet had an insight like: ‘this is a problem I can solve much more elegantly with macros than with plain functional code’.
I liked Chapters 1 and 2 of On Lisp. After that, I felt like it degenerated into a design patterns book. The design patterns Paul Graham need 27 years ago aren’t the design patterns I need right now. I prefer Practical Common Lisp as a textbook. Ironically, Practical Common Lisp book is extremely impractical in 2020 but I feel it demonstrates high-level Lisp programming better through its use of extremely dense code.
I’ve never read Let Over Lambda. Judging by the table of contents, it looks like an exceptionally good book on how to write a macro but—once again—not when to write a macro.
Instead of diving back into your Lisp textbooks, I recommend this advice from Paul Graham’s Rarely-Asked Questons:
How can I become really good at Lisp programming?
Write an application big enough that you can make the lower levels into a language layer. Embedded languages (or as they now seem to be called, DSLs) are the essence of Lisp hacking.
I thought if I read enough examples of macros and practice writing powerful ones (not just that custom cond I mentioned), I will start seeing possible applications. You appear to have a different opinion. Anyway, I think I would get your point if I explored more more real world macro-enabled code.
Practical Common Lisp book is extremely impractical in 2020 but I feel it demonstrates high-level Lisp programming better through its use of extremely dense code.
I have read The Joy of Clojure, which imbued me with some good Lisp spirit. And I’ve moved Practical Common Lisp up on my reading list above On Lisp and Let Over Lambda, thanks to your brief review.
Thanks for the detailed reply!
Yeah, this is the difficult thing for me. I’ve written extensions of basic forms like
cond
. But I haven’t yet had an insight like: ‘this is a problem I can solve much more elegantly with macros than with plain functional code’.Maybe a way to get there would be to dive back into On Lisp (http://www.paulgraham.com/onlisp.html) or Let Over Lambda (https://letoverlambda.com/). Although, if you know of no good books, maybe these don’t suffice either. :-)
I liked Chapters 1 and 2 of On Lisp. After that, I felt like it degenerated into a design patterns book. The design patterns Paul Graham need 27 years ago aren’t the design patterns I need right now. I prefer Practical Common Lisp as a textbook. Ironically, Practical Common Lisp book is extremely impractical in 2020 but I feel it demonstrates high-level Lisp programming better through its use of extremely dense code.
I’ve never read Let Over Lambda. Judging by the table of contents, it looks like an exceptionally good book on how to write a macro but—once again—not when to write a macro.
Instead of diving back into your Lisp textbooks, I recommend this advice from Paul Graham’s Rarely-Asked Questons:
I thought if I read enough examples of macros and practice writing powerful ones (not just that custom
cond
I mentioned), I will start seeing possible applications. You appear to have a different opinion. Anyway, I think I would get your point if I explored more more real world macro-enabled code.I have read The Joy of Clojure, which imbued me with some good Lisp spirit. And I’ve moved Practical Common Lisp up on my reading list above On Lisp and Let Over Lambda, thanks to your brief review.
Good reminder. I think I’ve done something like that here: https://github.com/rmoehn/jursey/blob/master/test/clarification-swallows.repl