3 ms·
I was so impressed by pavelludiq's comment (I had the impulse to post a comment citing Greenspun but refrained, their comment was so much better than what I wou
by spacemanaki 16y ago
I was so impressed by pavelludiq's comment (I had the impulse to post a comment citing Greenspun but refrained, their comment was so much better than what I would have posted) and I tried to come up with a tiny example of a defmacro which would show where Lispy is reinventing the wheel, but really, why bother when much better writers and teachers have already. I think Peter Seibel's Practical Common Lisp is a great intro and this chapter is so early in the book it nearly stands on its own:
http://www.gigamonkeys.com/book/practical-a-simple-database.html http://www.gigamonkeys.com/book/practical-a-simple-database....
There's a couple of simple macros in there and it's not that long a read.
Then there's Casting SPELs in Lisp which is another great concise intro to macros that shows them off:
http://www.lisperati.com/casting.html http://www.lisperati.com/casting.html
I don't think I could do better than that. Both of those are short enough that you can read them in an evening. If you're not hooked by then, at least you haven't spent much time on it.
- erikpukinskis 16y agoThanks!