Steel Bank Common Lisp

wanted: extensible source-locations

Reported by Nikodemus Siivola on 2010-11-16
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Wishlist
Unassigned

Bug Description

Provide support for users to attach source-locations to things.

In particular, for stuff like:

  (defmacro deflater (name lambda-list &body body)
    (push `(defun ,name ,lambda-list ,@body) *later*))

  (defmacro now ()
    `(progn ,@*later*))

so that the defuns can get the right source locations -- the DEFLATER instead of the NOW.

Robert P. Goldman (rpgoldman) wrote :

I believe that this is the sort of thing for which TCR has been developing the EDITOR-HINTS library. The notion is to provide a portable way for the Common Lisp to signal useful information to the editor (SLIME).

Allegro CL has a source-recording facility that handles macros. IIRC there are two pieces to the facility:

1. Somewhere in the expansion of your macro you call a function that records source-file information. So you might extract one or more significant names, and record the source files for them. The source-file recording function takes a separate key, like the way DOCUMENTATION does in CL, but you can extend the set of keys.

2. You also define a way to map from your macro to the name (or names) it defines. E.g., simple macros might just extract the second element of the defining form as the name; more complicated macros would have a more complicated mapping function. The editor, when looking for a definition for FOO, first uses the source file recording to find the right file, then can grovel over the file, and use this "extractor" function to pull symbols out of s-expressions to find the right textual position.

Seems like sinking effort into a portable mechanism like this would be a big win.

Nikodemus Siivola (nikodemus) wrote :

I don't completely disagree, but a portable mechanism doesn't help with the above case -- it still needs an unportable backend to (1) get the source location (2) associate that with a regular function.

I'll leave the portable editor-layer to other people for now.

summary: - extensible source-locations
+ wanted: extensible source-locations
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers