4 ms·
Those macros are just that, macros. Implementing them in any sexp-based language is trivial. I think people are stuck in the "C MACROS ARE BAD" thinking. It is
by bjoli 7y ago
Those macros are just that, macros. Implementing them in any sexp-based language is trivial.
I think people are stuck in the "C MACROS ARE BAD" thinking. It is a really powerful feature. CLOS, the world's most flexible oo system, was conceived as a bunch of macros. Racket's pattern matching is really just a macro (that could almost be called a compiler). Useful things that can be syntactically integrated into a language as an afterthought, yet still look and feel first class.
- tombert 7y agoNo argument here; I'm a pretty big supporter of Lisps as a whole; most of my personal projects are done with Clojure (or ClojureScript) in no small part due to the power afforded to me by macros. In fairness to a lot of people, I think that most of the folks in the "MACROS ARE BAD!!!" crowd are under the impression that C macros are the only way people do them, and assume that even Lisp macros are just are also just glorified text-expansion. I would be against macros too if that were the case.
- kazinator 7y agoI suspect that most of "MACROS ARE BAD!" folks only know Python or Java, and have never used a macro preprocessor, just like the "COBOL IS BAD!!" people of the past who had zero experience with Cobol. > I would be against macros too if that were the case. I wouldn't; even text expansion macros are useful, and can be done better than what is in C. Using C preprocessing as an example criticize only textual/token macro expansion is still a strawman.