Helmut Eller heller@common-lisp.net writes:
- Tobias C. Rittweiler [2008-02-24 21:06+0100] writes:
Helmut Eller heller@common-lisp.net writes:
Yes, that's a useful application. I don't quite understand how FIND-DEFINITIONS can be used here because FIND-DEFINITIONS expects a (generalized) name as argument. One possibility would be to use a (yet-to-be-invented) function, say FUNCTION-NAME, which returns the name of a function object and passing that name to FIND-DEFINITIONS. But if we invent a FUNCTION-NAME function, we could just as well invent FUNCTION-SOURCE-LOCATION and CLASS-SOURCE-LOCATION, which would easier to use than FIND-DEFINITIONS.
I decided to do this way, because SWANK-BACKEND:FUNCTION-NAME does in fact already exist. And you can retrieve the name of structures and classes via TYPE-OF.
I guess that this will not fly for stuff like:
(setf (fdefinition 'foo) (lambda () ...)) (find-definition-for-thing #'foo)
Probably not.
Do you prefer the explicit SOURCE-LOCATION machinery?
-T.