Hi,
the sharp-m reader macro function (grid/functions.lisp, l. 202) ignores cl:*read-suppress*. When *read-suppress* is true, the function unconditionally signals the error "Initial-contents specified as NIL."
The following code can be used to observe the behaviour. No matter what (valid or invalid) code is inside the sharp-m parentheses, the error will be signaled.
(let ((*read-suppress* t)) (with-input-from-string (stream "#m(1 2 3)") (read stream)))
I encountered this in Emacs: When I compile a file with C-c C-k and the compilation yields warnings or notes, the Slime/SBCL combination seems to re-read the file with *read-suppress*. Any sharp-m macro that is then read triggers the error. Try with:
#m(1 2 3) (defun foo (bar)) ; provoke unused variable style-warning
My solution is to put a simple "(unless *read-suppress* ...)" at the appropriate place: if *read-suppress* is true, the macro contents will still be read but then ignored. A patch is attached.
The patch did not break any tests for me.
Does this seem sane? Comments?
Martin