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.
Cheers,
Christophe