With Clojure, I now need to take the attitude I had towards Python two and 1/2 years ago. I knew that our automated water meter reading project’s beginning was looming, and I would have to start designing and implementing code in Python, so I chose small tasks to get used to the language. Therefore, I know to use Clojure for something, even if it is script-like and small. That is the advice Amit Rathore gave his recent CodeLesson.com Clojure course, and what I have read in Clojure books and in Clojure blogs and articles. So, OK, that’s not hard to understand or to carry out.
But what is troubling me are how to see where and why to implement Clojure macros. I am a believer in using language features. Of course you can abuse anything. In Bliss, the macro system was so powerful that some DEC engineers rewrote Bliss so it looked like Basic. Some early C++ implementors (mid 1990s) went of screaming into the weeds, and had all kinds of unmanageable objects using single and multiple inheritance without thinking first. It did not mean class inheritance was a bad thing.
The big question for me now is why and where do I want to use Clojure macros, and how will my mind figure this out instinctively. I have read quite a few good Clojure books on the subject and studied the examples. I like the idea of having the macros do a lot of work at compile, instead of, run time. I’m not sitting around waiting for it to happen by divine miracle, so onward with drumming up some Clojure work, and trying to see one day what others seem to easily today.