From: Gerd M. <ger...@t-...> - 2003-03-10 12:41:39
|
Tony Martinez <to...@te...> writes: > * (defclass foo () ((bar :accessor foo-bar))) > > #<STANDARD-CLASS FOO> > * (profile foo-bar) > > * (defclass foo () ((bar :accessor foo-bar))) > > debugger invoked on condition of type SB-INT:SIMPLE-PROGRAM-ERROR: > FOO-BAR already names an ordinary function or a macro. > > (SB-PCL::GENERIC-CLOBBERS-FUNCTION FOO-BAR) > 0] > > I've investigated b) a little. After poking around, I think the > problem is that ENSURE-GENERIC-FUNCTION (ultimately) uses FDEFINITION > to burrow through any encapsulations and access the function. > However, PROFILE installs it's own encapsulation closures _without_ > going through FDEFINITION's encapsulation mechanism, so FDEFINITION > returns the PROFILE encapsulation closure, which isn't a generic > function, hence the error. I don't know if/how this applies to SBCL, but in my PCL I've now changed GDEFINITION to (defun gdefinition (name) (let ((fdefn (fdefinition name)) (info (gethash name profile::*profile-info*))) (if (and info (eq fdefn (profile::profile-info-new-definition info))) (profile::profile-info-old-definition info) fdefn))) plus changes of some uses of FDEFINITION to GDEFINITION. It might have been nicer if PROFILE used encapsulations. If that's possible, I haven't looked too closely. |