[slime-devel] sbcl sources support

Christophe Rhodes csr21 at cam.ac.uk
Wed Jun 9 20:00:26 UTC 2004


Hi,

Attached is a (probably corrupt, sorry) patch which partly implements
DWIM when slime commands are executed on sbcl sources.

The background: for those who do not know the detail, suffice it to
say that, out of the box, sbcl sources are unreadable (in the READ
sense) to a running sbcl.  The unreadability comes in two forms:
firstly, all of the package names are different (this enables sbcl to
build cleanly even from itself); secondly, the #! reader macro
(reserved to the user) is used extensively by the sources to implement
reader conditionals against the *features* that will be active under
the to-be-built lisp.

This patch uses knowledge of sbcl internals (some of which should
probably be in sb-introspect; they'll get moved there once we
establish exactly what we need) to, firstly, modify the behaviour of
FIND-PACKAGE to treat SB!FOO as a nickname for SB-FOO; and secondly,
to temporarily replace the current readtable with one which includes
a #! reader macro.  This, I think, is good enough for a DWIM system;
it gets about 99% of sbcl sources right.

My implementation of it is, of course, sucky.  I don't really have a
handle on the package discipline, nor where a feature like this
logically belongs in slime -- it seems to cross-cut several layers.
On top of this, I'm fairly sure I haven't found all the places where
this is necessary: essentially all places that could do READ need to
be wrapped.  [ The implementation of the #! reader macro logically
belongs in sb-introspect, I think, but it isn't there yet. ]

I hope this patch gives enough of a flavour for what is necessary, and
enough information to either desuckify it for me, or to tell me what I
should do to make it suck less.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: slime.diff
URL: <https://mailman.common-lisp.net/pipermail/slime-devel/attachments/20040609/90ecd1c8/attachment.ksh>
-------------- next part --------------

Cheers,

Christophe
-- 
http://www-jcsu.jesus.cam.ac.uk/~csr21/       +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%")    (pprint #36rJesusCollegeCambridge)


More information about the slime-devel mailing list