[Antik-devel] Sharp-m reader macro function ignores *read-suppress* (+ patch)

Martin Schmauder martinschmauder at googlemail.com
Wed Apr 25 13:30:11 UTC 2012


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Sharp-m-reader-macro-function-must-not-ignore-read-s.patch
Type: text/x-patch
Size: 1440 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/antik-devel/attachments/20120425/d19d4fc0/attachment.bin>


More information about the antik-devel mailing list