Mark H Weaver <[email protected]> writes:
> Krister Svanlund <[email protected]> writes:
>> For example an instance of a class inheriting a class that inherits
>> <applicable-struct> that defines 'procedure is not applicable.
>
> Looking at the code, it is clear that in order for a GOOPS instance to
> be applicable, it is not enough for <applicable-struct> to be a
> superclass. It is also necessary for the _metaclass_ of its class to
> have the SCM_VTABLE_FLAG_APPLICABLE_VTABLE bit set.
>
> One such metaclass is already built-in: <applicable-struct-class>, which
> is the metaclass for <applicable-struct>,
So the solution to Krister's problem is to make sure that every class
he's interested in is defined as
(define-class <whatnot> (supers...)
...
#:metaclass <applicable-struct-class>)
Right?
> but if you'd like to define
> your own metaclass for applicable objects, you can set the bit manually
> on the metaclass as described by Ludovic.
Would this be needed, if the above works?
> However, keep in mind that the presence of that bit in the metaclass
> indicates that the first slot of all instances _must_ be the procedure
> slot.
Might the (define-class ... #:metaclass <applicable-struct-class>)
ensure that, by some kind of of compute-slots customisation...? I took
a look but unfortunately couldn't see this in the code.
Neil