From: Andreas Rottmann <a.rottmann@gmx.at>
Subject: [GOOPS] Specializing <generic> to allow lazy method addition
Date: Fri, 23 Jan 2004 12:38:45 +0100 [thread overview]
Message-ID: <87fze6x5bu.fsf_-_@alice.rotty.yi.org> (raw)
In-Reply-To: <1074535797.1517.64.camel@localhost> (Andy Wingo's message of "Mon, 19 Jan 2004 20:09:58 +0200")
Andy Wingo <wingo@pobox.com> writes:
> On Thu, 2003-12-04 at 02:25, Kevin Ryde wrote:
>> I wonder if some lazy initializing would be possible, like catch a
>> failed method dispatch and add only at that time. (But my ignorance
>> of goops is pretty profound, so maybe it's not feasible.)
>
> This is really a direct response to Andreas' question a couple days ago,
> which I have read but don't have on my laptop...
>
> I think I said something like make `add-method' cache methods, only
> adding them when `no-method' is called. We can look at the GOOPS manual
> (goops.info) to see what I mean.
>
> `Method Definition Internals' states that after ensuring the generic and
> creating the method, that the method is added to the generic via the
> generic `add-method!'. If the generics we create are actually subclasses
> of <generic>, we can specify `add-method!' to just keep the method in a
> holding pen of sorts. Which is to say,
>
> (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?
[0] http://mail.gnu.org/archive/html/guile-user/2002-04/msg00197.html
[1] http://mail.gnu.org/archive/html/guile-user/2003-07/msg00061.html
Thanks,
Andy
--
Andreas Rottmann | Rotty@ICQ | 118634484@ICQ | a.rottmann@gmx.at
http://yi.org/rotty | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint | DFB4 4EB4 78A4 5EEE 6219 F228 F92F CFC5 01FD 5B62
Python is executable pseudocode, Perl is executable line-noise.
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
next prev parent reply other threads:[~2004-01-23 11:38 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 ` Andreas Rottmann [this message]
2004-01-27 15:17 ` [GOOPS] Specializing <generic> to allow lazy method addition Mikael Djurfeldt
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=87fze6x5bu.fsf_-_@alice.rotty.yi.org \
--to=a.rottmann@gmx.at \
/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).