I am new to Clojure. I started couple of months ago. I am trying to learn Macros.
I initially got confused understanding difference between macros and higher-order functions in Clojure as a higher order function could take lambdas and execute one of them how many times it wanted based on any conditions and filter.
So I posted a question with a simple example regarding this on StackOverflow itself. I got my doubts cleared from the answer.
This is what I understood,
- Macros won't evaluate all the arguments unlike functions to evaluate the body.
- Macros can be selective about what to evaluate and what not and how to convert one piece of code into another using quote,unquote and splicing syntax.
- The final code that comes out of the macro is then evaluated.
So my question is, How is it different from preprocessor directives and macros used in C ? What power does Lisp/Clojure macros give to the developers which C macros completely lack and are often used widely.