Hi,
I have encountered a problem with the sharp-m reader macro function.
The sharp-m reader macro function (lambda in grid/functions.lisp, l. 202) uses the function cl:read-delimited-list to read the macro arguments. However, when cl:*read-suppress* is true, read-delimited-list always returns nil (See *read-suppress* in CLHS.) That value is then (wrongly) passed to grid:check-initial-contents, which (rightly) 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)))
The solution is to call read-delimited-list and then check if we have to ignore its return value with "(unless *read-suppress* ...)". Patch attached.
By the way, how I encountered this issue: 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)) ; unused variable style-warning
Comments?
Martin
This makes sense, thanks. I've applied the patch to the cffi-libffi branch.
Liam
On Wed, Apr 18, 2012 at 11:27 AM, Martin Schmauder < martinschmauder@googlemail.com> wrote:
Hi,
I have encountered a problem with the sharp-m reader macro function.
The sharp-m reader macro function (lambda in grid/functions.lisp, l. 202) uses the function cl:read-delimited-list to read the macro arguments. However, when cl:*read-suppress* is true, read-delimited-list always returns nil (See *read-suppress* in CLHS.) That value is then (wrongly) passed to grid:check-initial-contents, which (rightly) 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)))
The solution is to call read-delimited-list and then check if we have to ignore its return value with "(unless *read-suppress* ...)". Patch attached.
By the way, how I encountered this issue: 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)) ; unused variable style-warning
Comments?
Martin
Antik-devel mailing list Antik-devel@common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/antik-devel