[Slime-devel] Showing two test failures...

Paulo Madeira acelent at gmail.com
Mon Aug 25 17:37:37 UTC 2014


2014-08-25 8:38 GMT+01:00 Helmut Eller:
> compile-defun-4 fails due to the "improved" backquote stuff.  I haven't
> followed the discussion.  Why is it neccesary to that ,X returns
> a struct instead of somehing more traditionanal like (unquote X)?

As I see it, that's a correct reader error, you shouldn't be able to

    `(list 1 ,1 , at 1 (bar))

That , at 1 cause the equivalent append to fail:

    (append (list `1) (list 1) 1 (list `(bar)))

Although I'm not sure I'm looking at the right point of failure, and I
didn't actually test it.

> find-definition\.2-1 fails because a change to set-macro-character.
> This code used to work:
>
> (let* ((rt (copy-readtable nil)))
>   (flet ((wrap (fun) (lambda (&rest args) (apply args fun))))
>     (list
>      (assert (get-dispatch-macro-character #\# #\. rt))
>      (multiple-value-bind (fun nt) (get-macro-character #\# rt)
>        (set-macro-character #\# (wrap fun) nt rt))
>      (assert (get-dispatch-macro-character #\# #\. rt)))))
>
> but no longer does.  Does somebody know if this code is actually
> non-portable?

It is actually non-portable, the macro character function is provided
by the implementation through make-dispatch-macro-character:

http://www.lispworks.com/documentation/HyperSpec/Body/02_add.htm

The dispatch character table may be attached to the macro character
function, e.g. a funcallable-standard-object with a slot containing
the table.  Hence the need for make-dispatch-macro-character.  In the
case of SBCL, it's a bit more twisted, it actually checks for the
closure's value:

https://github.com/sbcl/sbcl/blob/82e75708c947be3ae4e7884241526ba9c81840f6/src/code/reader.lisp#L268

Best regards,

Paulo Madeira




More information about the slime-devel mailing list