Programmers often add comments for various reasons, such as explaining code or temporarily disabling code.
Clojure has three ways to add comments or comment out a section.
comment
macro;
reader macro#_
reader macro
comment
macroThe syntax is like a function: (comment & body)
.
With this comment style, we can write multi-line comments or comment out multi-line code blocks.
;
(semicolon) reader macroThis is used to comment out a single line.
Clojure ignores everything from the ;
(semicolon) to the end of the line.
#_
reader macroThis is used to comment out a form.
For example, a corresponding pair of (
and )
, or [
and ]
.
The form can be nested.
ClojureDocs
The Reader “Macro characters” section, “Comment” and “Dispatch”
Clojure Style Guide
GetClojure