From: Christophe R. <cr...@us...> - 2007-06-02 09:04:21
|
Update of /cvsroot/sbcl/sbcl/contrib/sb-introspect In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32733/contrib/sb-introspect Modified Files: sb-introspect.lisp Log Message: 1.0.6.12: Improve user-subclassed SB-MOP:SPECIALIZER support In order to support surface syntax for users in DEFMETHOD, define and bootstrap a new SB-PCL:MAKE-METHOD-SPECIALIZERS-FORM (a bit like SB-MOP:MAKE-METHOD-LAMBDA). This or something like it is fundamentally necessary to support EQL specializers, which as syntax have a bit which is syntax and a bit which is evaluated in the lexical environment of the DEFMETHOD form. Bootstrapping it is a little tedious, but (eventually) work out where parsed specializers can be made and where we don't yet have FIND-CLASS in the bootstrap. In the course of that, note that we need to be able to parse and unparse specializers at runtime: parsing to support FIND-METHOD; unparsing to get nice names for our method functions in backtraces. Define an experimental interface for that, too (see NEWS). In the process, fix a couple of bugs in NO-NEXT-METHOD handling; it is not safe to assume that the compile-time method name can be used to find the method object. Instead, fight a little bit with the file compiler to have a cons cell shared between the method function and the method initargs, and arrange to have the cell's CAR be set to the method once it is created; then we can do NO-NEXT-METHOD sanely. Tests for the no-next-method stuff, and adjust wonky find-method specializer arguments in other tests. Index: sb-introspect.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/contrib/sb-introspect/sb-introspect.lisp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- sb-introspect.lisp 4 May 2007 11:49:21 -0000 1.23 +++ sb-introspect.lisp 2 Jun 2007 09:04:15 -0000 1.24 @@ -320,8 +320,11 @@ (when source (setf (definition-source-description source) (append (method-qualifiers object) - (sb-pcl::unparse-specializers - (sb-mop:method-specializers object))))) + (if (sb-mop:method-generic-function object) + (sb-pcl::unparse-specializers + (sb-mop:method-generic-function object) + (sb-mop:method-specializers object)) + (sb-mop:method-specializers object))))) source)) #+sb-eval (sb-eval:interpreted-function |