The unless first macro in the macro guide seems a little misleading. From the text one would be surprised to learn that Clojure already has if-not. I actually like the name unless better, but I wouldn't write a macro just to scratch that itch.
Might be worth a note in the text that, while unless is an easy example, Clojure already has if-not.
True. And if-not is mentioned in the Introduction, but I think normally unless is closer to when-not in most languages?
I'll create an issue and do some research on unless elsewhere and update things accordingly...
https://github.com/clojure-doc/clojure-doc.github.io/issues/77
Good catch on unless being more like when-not. I guess it was the way it was presented in the guide that threw me off. The CLHS documents WHEN and UNLESS on the same page. Either way, reimplementing a core macro does seem a questionable way to introduce macros.
BTW, you wrote "`if-not` is mentioned in the Introduction". Mostly out of curiosity, what Introduction? Where is if-not mentioned?
At the end of this section of the Introduction to Clojure https://clojure-doc.org/articles/tutorials/introduction/#side-effects
Thanks! Found it. I was refreshing my memory as to whether Clojure macros were considered hygienic, so I went straight to the macro guide. I doubt many read the guides front-to-back, but they are useful.
*hygenic
*Oops, had it right in the first place: hygienic
BTW, I liked the mention of clojure.walk/macroexpand-all. I either missed that one all these years or had forgotten about it. Good debugging tool.
For the most part, for the target audience for clojure-doc, the issue of hygienic vs anaphoric etc isn't really relevant. Clojure encourages using functions over macros wherever possible, hence the joke that "The first rule of Macro Club is, don't write macros!"...
http://clojure.org hardly mentions the topic at all (and, to be honest, says very little about macros anyway).