Subject: Re: (Lisp Support Call #29977) Xanalys support for SLIME project
From: Martin Simmons <[email-masked]>
To: [email-masked]
Cc: [email-masked], [email-masked]
Date: Wed, 12 May 2004 20:40:36 +0100

>>>>> On Tue, 11 May 2004 10:32:34 +1000, [email-masked] said:

  ap> Dear support,

  ap> As we at Memetrics are users of SLIME, the new emacs/lisp 
  ap> interface, and have some paid support incidents which will
  ap> lapse in a couple of months, we thought we'd be happy to
  ap> spend 1 or 2 of them on getting Xanalys to help improve SLIME
  ap> for us.  To this end, I asked the main maintainer of the
  ap> Lispworks backend for SLIME, Helmut Eller, what he would
  ap> like to see from Xanalys, and he came up with the following:

  >> Alain wrote:
  >> 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.

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

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

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

  ap> I think this is indeed a nice function to have.

Hi there,

We could implement DSPEC-STREAM-POSITION, but it would just involve reading
forms from the file and matching their dspecs so it sounds like some of this
code should be generic.  LW:TOP-LEVEL-FORM things won't work because the
compiler aggregates these (forms containing definitions really have to be
named and recorded).  For FLET, LABELS and things like DEFSTRUCT, it would
find the positions of the topmost form containing them.

  ap>                                                  In addition, I would
  ap> request sufficient to support LIST-CALLERS, and WHO-BINDS, 
  ap> WHO-SETS, WHO-MACROEXPANDS.

It looks like WHO-BINDS is already working, but WHO-REFERENCES and WHO-SETS is
not implemented the LW compiler.

I estimate that fixing WHO-REFERENCES/WHO-SETS, implementing LIST-CALLERS and
WHO-MACROEXPANDS and something like DSPEC-STREAM-POSITION is about the amount
of work for 1 support incident.

  ap> For reference, here is the list of currently unimplemented
  ap> interfaces, in SWANK-BACKEND.LISP v 1.43

  ap> ("ADD-FD-HANDLER"
  ap>  "ADD-SIGIO-HANDLER"
  ap>  "CALL-WITH-COMPILATION-HOOKS"
  ap>  "DISASSEMBLE-FRAME"
  ap>  "LIST-CALLERS"
  ap>  "PROFILE"
  ap>  "PROFILE-PACKAGE"
  ap>  "PROFILE-REPORT"
  ap>  "PROFILE-RESET"
  ap>  "PROFILED-FUNCTIONS"
  ap>  "QUIT-LISP"
  ap>  "REMOVE-FD-HANDLERS"
  ap>  "REMOVE-SIGIO-HANDLERS"
  ap>  "UNPROFILE"
  ap>  "WHO-MACROEXPANDS")

  ap> Clearly not all these are in fact applicable, but perhaps the
  ap> cross referencing and profiling ones could be implemented.

It looks like most of the profiling API can be defined using symbols externals
in the HCL package.

  ap> Helmut further wrote:

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

  ap> This is of course a lot less well defined, but perhaps a quick
  ap> readthrough by Dave Fox or Martin Simmons would not take too much
  ap> time; I'm sure their help and comments would be of use to the
  ap> SLIME project and worth an incident to Memetrics.

We could export or provide alternatives for the socket and compiler things,
but we don't want to export or document the dbg internals.

Regards,

Martin Simmons			[email-masked]
Xanalys Technical Support 	
http://www.lispworks.com/support/