I want to define a macro which can comment a s-expression, for example:
I hope that
(list 1 2 (comment-macro (something))) -> (1 2)
But if I define the macro like this
(defmacro comment-macro (x))
the result of the above form is actually
(1 2 nil)
You cannot accomplish what you want with a regular macro because its primary value (or nil
if no values are returned) will always be used.
However, there are two common options:
comment: #| ... |#
- for general text
feature expressions: #+(or) ...
or #-(and) ...
- for (temporarily?) disabling code
You can also define your own read macros using set-macro-character
and set-dispatch-macro-character
.