guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making every goops object applicable


From: Mark H Weaver
Subject: Re: Making every goops object applicable
Date: Tue, 15 May 2012 11:46:57 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Krister Svanlund <address@hidden> 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>, 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.

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.

     Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]