unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.homelinux.net>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-devel@gnu.org
Subject: Re: Making every goops object applicable
Date: Tue, 15 May 2012 21:43:00 +0200	[thread overview]
Message-ID: <87mx59z0vv.fsf@neil-laptop.ossau.uklinux.net> (raw)
In-Reply-To: <87fwb1e9am.fsf@netris.org> (Mark H. Weaver's message of "Tue, 15 May 2012 11:46:57 -0400")

Mark H Weaver <mhw@netris.org> writes:

> Krister Svanlund <krister.svanlund@gmail.com> 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





  reply	other threads:[~2012-05-15 19:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-14 17:24 Making every goops object applicable Krister Svanlund
2012-05-14 22:16 ` Mark H Weaver
     [not found]   ` <CAO_vGe-fjX4iHusc5FdLV89i6+eBt3iCF4KP_S43LbP2ZQu4UA@mail.gmail.com>
2012-05-15  0:46     ` Fwd: " Krister Svanlund
2012-05-15 15:46     ` Mark H Weaver
2012-05-15 19:43       ` Neil Jerram [this message]
2012-05-16  5:18         ` Mark H Weaver
2012-05-15 12:31 ` Ludovic Courtès
2012-05-15 18:36 ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mx59z0vv.fsf@neil-laptop.ossau.uklinux.net \
    --to=neil@ossau.homelinux.net \
    --cc=guile-devel@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).