On Sun, Jan 11, 2009 at 8:48 PM, Tobias C. Rittweiler <tcr@...> wrote:
> The problem I see is that it's not obvious to a user that what is
> returned by CURRENT-SOURCE-LOCATION is mostly for internal affairs, and
> he should rather rely on SB-INTROSPECT.
I'm not sure I understand. The question of obviousness if IMO best
clarified by documentation, which is as of yet still missing from the
Here's what the documentation would look like, approximately:
SOURCE LOCATION PROTOCOL
SBCL provides a way for users to associate source location information
with their objects. For source location information to be available
for an object, there must be an applicable method on SOURCE-LOCATION.
Such a method should return either NIL (for no source location
information), or an object resulting from the macroexpansion of
(Add an example of what to do and what not to do, and explain which
object already have source locations associated with them.)
Source locations provided using this protocol are at the moment
accessible using the SB-INTROSPECT contributed module, and eg. M-. in
(Then document SB-INTROSPECT in the manual.)
> a) not exporting the stuff from SB-EXT,
I don't see the benefit in this. Doing this just adds a spurious
dependency to SB-INTROSPECT.
> b) instead of CURRENT-SOURCE-LOCATION and SOURCE-LOCATION use the
> names CURRENT-SOURCE-LOCATION-STUB and SOURCE-LOCATION-STUB.
> PS: I'd also favor renaming SB-INTROSPECT's DEFINITION-SOURCE to
> SOURCE-LOCATION. Doing that backwards-compatibly would result in some
> boilerplate code, but is possible.
> Perhaps I'm just mistaken on the role of SB-INTROSPECT's
> DEFINITION-SOURCE---it was my impression that it was named that way to
> minimize confusion with the compiler source-location stuff, not because
> its current name was a perfect fit.
SOURCE-LOCATION vs DEFINITION-SOURCE-LOCATION in the current patch was
intended as a non-confusing way of expressing this.
Perhaps unifying the two objects would be the best way to do it, but
requires a bit of more thought in order not to bloat the core.