[Slime-devel] M-. and interning

Helmut Eller eller.helmut at gmail.com
Tue Jan 27 20:21:01 UTC 2015


On Tue, Jan 27 2015, Zach Beane wrote:

> If I load a file like this:
>
>   (defpackage xach (:use cl))
>   (in-package xach)
>   (defun attack () 'attack)
[...]
> Why does ATTACK get interned in the current package?

To find the position in the file, M-. skips over the first two forms
with *read-suppress* = t.  But the last form is READ with
*read-suppress* = nil and with the current package.  That causes the
interning.

For a while it was possible to read the last form with *read-suppress*
as READ returned stuff like (nil (nil nil nil)) which was good enough to
find the beginning positions of lists, but later the reader in SBCL
changed and since then it only returns nil and we had to disable
*read-suppress*.

Instead of returning non-nil values, our source location recording
wrappers could probably store things like (1 (2 3 4)) in a global
variable.  Then we could again use *read-suppress*.

However, it looks like the patch to better support reader-macros needs
to bind *read-suppress* to nil while skipping over forms and will likely
cause more unwanted interning.

Helmut




More information about the slime-devel mailing list