by fmakunbound · 6y ago · 0 comments
; and ;; pretty usage is same as Common Lisp. #_ is replaced with #+nil in Common Lisp which is just a reader macro. ;;; is usually reserved for prose, and of course there's #| commenthere |# which is just another reader macro, and is suitable for code examples, where you can probably still eval it in your text editor.
(defmacro comment
"Ignores body, yields nil"
{:added "1.0"}
[& body])
A macro that takes any number of arguments and does absolutely nothing. This is still a macro invocation, so the arguments must not cause a reader error.It is a common pitfall to write non-readable content in a comment expression, which can certainly be confusing to newcomers who are used to less stringent multiline comments like /* ... */ or triple-quoted strings in Python.
Rich comments are not just the equivalent of a multiligne comments in other languages, I expect the statements inside of it to be run, often many times, during normal clojure development. I don't want to have broken code inside.
It's a gotcha, but in the end I think it's neat that it makes sure it's valid.