Skip to content
datum #;(comments) for common lisp
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin apparently pathnames are a known portability issue Jun 10, 2019
test readme cleanup, test princ, .travis debug builds with issues Jun 9, 2019
.gitignore first commit for common lisp datum comments ala Racket Jun 9, 2019
.travis.yml
LICENSE add LICENSE Jun 9, 2019
README.org
datum-comments.asd
enable.lisp
packages.lisp first commit for common lisp datum comments ala Racket Jun 9, 2019
read.lisp first commit for common lisp datum comments ala Racket Jun 9, 2019

README.org

datum comments for common lisp

https://travis-ci.org/tgbugs/datum-comments Racket style #; 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")

Installation

Quicklisp (coming soon)

(ql:quickload :datum-comments)

Manual install

Using 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)"

Usage

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)

Implementation support

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.

Standalone

(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)
You can’t perform that action at this time.