February 2018
Intermediate to advanced
304 pages
7h 11m
English
There are several ways to create comments in Clojure. The most common is to use ;, which creates a comment to the end of the line. While everything after the first ; is ignored, you’ll often see multiple semicolons to make a greater visual impact:
| | ;; this is a comment |
Clojure also contains a comment macro that ignores its body and returns nil. This is useful to wrap around a block of existing code. However, because it’s still read by the Clojure reader, it must be valid code.
| | (comment |
| | (defn ignore-me [] |
| | ;; not done yet |
| | )) |
One common use of the comment macro is to save a chunk of utility or test code in a comment block at the end of the file, which is useful in combination with REPL-based development.
Clojure also contains ...
Read now
Unlock full access