[slime-devel] Interactive compile loses DSPEC info

Helmut Eller e9626484 at stud3.tuwien.ac.at
Wed Mar 3 08:21:24 UTC 2004


Alain.Picard at memetrics.com writes:

>  > This doesn't seem to work:
>  > 
>  >   (dspec:at-location (:emacs-buffer) (defun foo ()))
>  >   (dspec:name-definition-locations '(function) 'foo)
>  > 
>  > Returns nothing particularly useful.
> 
> Yeah, I noticed.  :-(

I figured out how at-location is supposed to be used:

  (dspec:at-location (:emacs-buffer)
                     (funcall (compile nil (lambda () (defun foo ())))))
  (dspec:name-definition-locations '(function) 'foo)
  => (((defun foo) :emacs-buffer))

The macroexpansion of at-location reveals that dspec::*location* is
the interesting variable.  dspec:location is probably a compiler-macro
that expands to the compile-time value of dspec::*location*.

I patched compile-string-for-emacs again and set dspec::*location
directly.  Seems to work quite nicely.

> On a somewhat tangential topic; I have a support contract with
> Xanalys, and have a number of "incident reports" which are of
> the "use 'em or lose 'em" nature.  I would be willing to spend
> 1 or 2 of them on issues related to getting slime better integrated
> with Lispworks.

That would be very useful.

> If you (or anyone else) can specify to me _exactly_ what would be
> neat/required to get some missing features implemented, I could see
> what I could do about getting some patches and/or code from Xanalys.

I think a nice feature would be a function to get the precise position
of dspecs in a stream.  Currently we use some regexp kludges in Emacs
for that.  This fails sometimes and can't work if the definition is
generated by a macro.  I imagine a function like:

 (dspec-stream-position DSPEC STREAM)  =>  CHARACTER-OFFSET

DSPEC can be any dspec returned by NAME-DEFINED-DSPECS or by the
compiler.  In particular, the function should return reasonable values
for stuff like (LW:TOP-LEVEL-FORM 16), for dspecs for local functions
(from FLET or LABELS) and functions generated by macros (e.g.,
DEFSTRUCT or user defined macros).

It would also be useful if someone from Xanalys could have a look at
swank-lispworks.lisp and document/export the internal symbols we use
there, or tell us what we should use instead.

> Since I don't have much time to actually code for SLIME, you can
> consider this my modest contribution.  :-)

Thank you.  Your bug reports where also very useful.

> BTW--- THANK YOU to you and all other uber-cool slime developers.
> In just a few months, it's turned into a very pleasant developing
> environment.

Glad to hear.

Helmut.




More information about the slime-devel mailing list