News for hackers. Stuff that matters.
Re:A Year in Clojure by eval on Sunday October 07, 2018 @01:12PM (#18161586)
As an exercise you could do on a REPL what a macro would do. Say you have a file containing “(1 + 1)”. Reading this (using slurp and read-str) would yield a list, eval-ing this list would however fail as it’s not valid Clojure. To make it eval-able you transform the list (all the operations of the language are at your disposal as you’re just handling data) to (+ 1 1). It’s this operating on data between read and eval that macros do.

There are no comments on this comment yet.