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

Lisps are great to challenge your thinking, but (with Clojure) I got stuck at making sense of macros — way out of my depth at that moment in time.


I'd recommend studying some existing macros and spending time recreating them. Starting with simple use-cases of the macro and working up. Repeat this with a few macros and you'll eventually learn how they operate. Let Over Lambda is also a good (opinionated) book on macros (most of the book is available for free), and of course there's PG's On Lisp (jump to page 95 in the PDF if you're already comfortable with Lisp).

https://letoverlambda.com/index.cl/toc

https://paulgraham.com/onlisp.html


Thank you!


> I got stuck at making sense of macros

Are you simply staring intently at the macros, trying to make sense of them, or are you actually utilizing the macro-expanding feature in your editor? Or perhaps you're grappling with writing macros yourself? Macros can be tricky, which is why Clojurists often avoid creating new ones unless there's a compelling reason to do so. There's an old book called "Mastering Clojure macros", it's tiny - fewer that a hundred pages. It helped me back when I was learning Clojure.


more trying to understand really, this blew my mind at a time https://aphyr.com/posts/305-clojure-from-the-ground-up-macro...




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

Search: