datum comments for common lisp
#; comments implemented as a dispatch macro.
#; ; regular comments are treated as whitespace (and the next datum is skipped by the reader) #; (so you can skip a datum inline) (print "and not just a line or block")
sbcl as an example.
git clone https://github.com/tgbugs/datum-comments.git cat "(push (truename #p\"datum-comments\") asdf:*central-registry*)" >> ~/.sbclrc sbcl --eval "(asdf:load-system :datum-comments) #;(i im a comment) (print 'hello)"
Since comments are a fundamental part of a language datum-comments automatically
registers itself as a dispatch macro for the
#; symbol. Install via one of the
methods above and then include
:datum-comments in the
:use section of
defpackage where you want to be able to use datum comments, e.g. as
(defpackage :my-package (:use :cl :datum-comments))
at which point you can #;(use datum comments to your heart’s content)
This should work on any cl that has
asdf, and the copy/paste version
below should work on pretty much anything.
See travis for the list
of tested working implementations.
(defpackage :datum-comments (:use :cl)) (in-package :datum-comments) (defun datum-comment (stream char arg) (declare (ignore char arg)) (read-preserving-whitespace stream t nil t) (values)) (set-dispatch-macro-character #\# #\; #'datum-comment)