[Openmcl-devel] Patch for slot-documentation bug

Gary King gwking at metabang.com
Thu Feb 2 11:42:13 PST 2006


On Feb 2, 2006, at 2:17 PM, Pascal Costanza wrote:

> Wait a moment: Are you saying that this is equivalent to (slot- 
> value slot 'cl:documentation)?
>
> This would be a violation of the CLOS MOP specification which  
> states the following in "Restrictions on Implementations":
>
> "No portable class Cp may inherit, by virtue of being a direct or  
> indirect subclass of a specified class, any slot for which the name  
> is a symbol accessible in the common-lisp-user package or exported  
> by any package defined in the ANSI Common Lisp standard."

Hi Pascal,

I'm not familiar enough with how OpenMCL bootstraps it's CLOS to  
answer definitively but I think that there is a slot named  
cl:documentation. I used the inspector to look at a slot-definition;  
look at item 10 below:

> RW> (moptilities::get-slot-definition 'list-container 'contents)
> #<STANDARD-EFFECTIVE-SLOT-DEFINITION for instance slot CONTENTS  
> #x84FD516>
> T
> RW> (inspect *)
> [0]     #<STANDARD-EFFECTIVE-SLOT-DEFINITION for instance slot  
> CONTENTS #x84FD516>
> [1]     Class: #<STANDARD-CLASS CCL:STANDARD-EFFECTIVE-SLOT- 
> DEFINITION>
> [2]     Wrapper: #<CCL::CLASS-WRAPPER CCL:STANDARD-EFFECTIVE-SLOT- 
> DEFINITION #x806DB5E>
>         Instance slots
> [4]     CCL::NAME: CONTENTS
> [5]     TYPE: T
> [6]     CCL::INITFUNCTION: #<CCL:COMPILED-LEXICAL-CLOSURE #x84F8FF6>
> [7]     CCL::INITFORM: 'NIL
> [8]     CCL::INITARGS: NIL
> [9]     CCL::ALLOCATION: :INSTANCE
> [10]    DOCUMENTATION: NIL
> [11]    CLASS: #<STANDARD-CLASS CONTENTS-AS-LIST-MIXIN>
> [12]    CCL::LOCATION: 2
> [13]    CCL::SLOT-ID: #<SLOT-ID for CONTENTS/567 #x84F31B6>
> [14]    CCL::TYPE-PREDICATE: CCL:TRUE
> Inspect> (:i 10)
> [0]  Symbol: NIL
>         Constant, Type Specifier
> [2]     EXTERNAL in package: #<Package "COMMON-LISP">
> [3]     Print name: "NIL"
> [4]     Value: NIL
> [5]     Function: #<Unbound>
> [6]     Plist: NIL
> Inspect 1> :pop
>
> Inspect> :pop
>
> ; No value
> RW>

the code that prints this line is  standard-object-line-n (in  
describe.lisp). It has this in it:

> (let ((slot-name (slot-definition-name
>                   (elt slotds (- n shared-start 1)))))
>   (values (slot-value-or-unbound instance slot-name)
>           slot-name
>           :colon))

I believe that OpenMCL and MCL still have essentially the same MOP  
and this was the same patch that I proposed for OpenMCL I'm not sure  
what would need to be done to adhere to the MOP standard. What is the  
definition of a "portable class"? Is standard-slot-definition  
"portable"?

-- 
Gary Warren King
metabang.com
http://www.metabang.com/





More information about the Openmcl-devel mailing list