[Openmcl-devel] Is this a bug?

Gary Byers gb at clozure.com
Thu Dec 4 04:34:19 PST 2008


I agree that it's a bug. You can work around it by explicitly passing
a :DIRECT-SUPERCLASSES initarg when creating the class:

? (make-instance 'standard-class :direct-superclasses (find-class 'standard-object)))
#<STANDARD-CLASS NIL>
? (class-precedence-list *)
(#<STANDARD-CLASS NIL> #<STANDARD-CLASS STANDARD-OBJECT> #<BUILT-IN-CLASS T>)
which is little more reasonable than the CPL would be otherwise.

This ordinarily happens upstream (in ENSURE-CLASS or
ENSURE-CLASS-USING-CLASS), but the MOP section
<http://www.alu.org/mop/dictionary.html#class-mo-init> clearly says
that this should default this way for instances of STANDARD-CLASS and
its subclasses (and default to a list of FUNCALLABLE-STANDARD-OBJECT
for FUNCALLABLE-STANDARD-CLASS), and that this should happen when the
class is being initialized.

There's an unrelated bug in that while trying to determine whether or
not an object's class is properly named, the PRINT-OBJECT method for
STANDARD-OBJECT calls FIND-CLASS letting the ERRORP argument default
to NIL.  So:

? (make-instance **)
will blow up trying to print that instance, but it'll create it.





On Wed, 3 Dec 2008, Ron Garret wrote:

> I'm not well versed enough in the MOP to know if this is a problem with me or 
> CCL, but the c.l.l. folks seem to think it's the latter:
>
> ? (make-instance (make-instance 'standard-class))
>> Error: No applicable method for args:
>>         (#<error printing #<STANDARD-CLASS NIL> #x30004181C99D>)
>>         to #<STANDARD-GENERIC-FUNCTION INITIALIZE-INSTANCE #x3000401BA85F>
>
> ? (allocate-instance (make-instance 'standard-class))
>> Error: No applicable method for args:
>>         (#<error printing #<STANDARD-CLASS NIL> #x30004181BF5D> 
>> #<SYNONYM-STREAM to *TERMINAL-IO* #x3000416CFD4D>)
>>         to #<STANDARD-GENERIC-FUNCTION PRINT-OBJECT #x3000401C0DCF>
>
> rg
>



More information about the Openmcl-devel mailing list