From: Mikael Djurfeldt <mdj@mit.edu>
Cc: Guile Users <guile-user@gnu.org>,
djurfeldt@nada.kth.se, guile-gtk-general@gnu.org
Subject: Re: [GOOPS] Specializing <generic> to allow lazy method addition
Date: Tue, 27 Jan 2004 10:17:20 -0500 [thread overview]
Message-ID: <xy74quhpgjj.fsf@chunk.mit.edu> (raw)
In-Reply-To: <87fze6x5bu.fsf_-_@alice.rotty.yi.org> (Andreas Rottmann's message of "Fri, 23 Jan 2004 12:38:45 +0100")
Andreas Rottmann <a.rottmann@gmx.at> writes:
>> (define-class <guile-gnome-generic> (<generic>)
>> (temp-methods :init-value '()))
>> (define-method (add-method! (generic <guile-gnome-generic>)
>> (method <method>))
>> ;; Note we don't call next-method
>> (slot-set! generic 'temp-methods
>> (cons method (slot-ref generic 'temp-methods))))
>>
> I tried to play around with this a bit and it seems it is not viable
> ATM; I experienced the problem described already in [0] and [1]. It
> seems noone has answered why %invalidate-method cache insists on a
> pure generic (from goops.c, in scm_sys_invalidate_method_cache_x):
>
> SCM_ASSERT (SCM_PUREGENERICP (gf), gf, SCM_ARG1, FUNC_NAME);
>
> and what 'pure' generics are all about; FWICT, pureness is a flag set
> for all built-in generic classes. Would someone of GOOPS knowledge
> please be so kind to shed some light on this issue?
The mechanism which allows you to subclass builtin classes like
<generic> and specialize functions to them is called meta object
protocols, or MOPs.
While the MOP for <class> works, the MOP for <generic> isn't yet
implemented. This is a shame and I've for very long had had the hope
to find time to fix it. What we really quickly should do is to
document this situation so that people know that they cannot yet
subclass <generic>.
The purity flag, which you ask about, marks that a class is
"untouched" by the user so that the C runtime can count on specific
slots existing and residing at specific locations within an object.
The idea is that the runtime will look for specialized functions only
if the class isn't pure.
M
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
next prev parent reply other threads:[~2004-01-27 15:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87smkc5b22.fsf@alice.rotty.yi.org>
[not found] ` <874qwhsa2u.fsf@zip.com.au>
2003-12-04 9:02 ` New g-wrap supported in guile-gtk--rotty-0.1! Andreas Rottmann
2003-12-04 14:14 ` Mikael Djurfeldt
2003-12-04 17:21 ` Andreas Rottmann
2003-12-04 22:33 ` Andreas Rottmann
2003-12-06 16:18 ` Andreas Rottmann
[not found] ` <1074535797.1517.64.camel@localhost>
2004-01-23 11:38 ` [GOOPS] Specializing <generic> to allow lazy method addition Andreas Rottmann
2004-01-27 15:17 ` Mikael Djurfeldt [this message]
2004-01-27 23:27 ` Stephen Compall
2004-01-28 2:14 ` Mikael Djurfeldt
2004-02-01 19:41 ` Guile warts (was: [GOOPS] Specializing <generic> to allow lazy method addition) Andy Wingo
2004-02-05 19:03 ` Guile warts Mikael Djurfeldt
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=xy74quhpgjj.fsf@chunk.mit.edu \
--to=mdj@mit.edu \
--cc=djurfeldt@nada.kth.se \
--cc=guile-gtk-general@gnu.org \
--cc=guile-user@gnu.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).