From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.user Subject: Re: [GOOPS] Specializing to allow lazy method addition Date: Tue, 27 Jan 2004 10:17:20 -0500 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: References: <87smkc5b22.fsf@alice.rotty.yi.org> <874qwhsa2u.fsf@zip.com.au> <1074535797.1517.64.camel@localhost> <87fze6x5bu.fsf_-_@alice.rotty.yi.org> Reply-To: djurfeldt@nada.kth.se NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1075216851 31023 80.91.224.253 (27 Jan 2004 15:20:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Jan 2004 15:20:51 +0000 (UTC) Cc: Guile Users , djurfeldt@nada.kth.se, guile-gtk-general@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Jan 27 16:20:40 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AlV15-0004uJ-00 for ; Tue, 27 Jan 2004 16:20:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AlV0W-0008KK-P6 for guile-user@m.gmane.org; Tue, 27 Jan 2004 10:20:04 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AlUzA-0007qv-M0 for guile-user@gnu.org; Tue, 27 Jan 2004 10:18:40 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AlUyc-0007Yr-UF for guile-user@gnu.org; Tue, 27 Jan 2004 10:18:38 -0500 Original-Received: from [213.212.20.77] (helo=kvast.blakulla.net) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AlUy5-0007Mo-7q; Tue, 27 Jan 2004 10:17:33 -0500 Original-Received: from chunk.mit.edu ([18.42.2.92] helo=chunk ident=Debian-exim) by kvast.blakulla.net with esmtp (Exim 3.36 #1 (Debian)) id 1AlUxt-000102-00; Tue, 27 Jan 2004 16:17:21 +0100 Original-Received: from mdj by chunk with local (Exim 4.30) id 1AlUxs-0006oG-MX; Tue, 27 Jan 2004 10:17:20 -0500 Original-To: Andreas Rottmann In-Reply-To: <87fze6x5bu.fsf_-_@alice.rotty.yi.org> (Andreas Rottmann's message of "Fri, 23 Jan 2004 12:38:45 +0100") User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2728 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2728 Andreas Rottmann writes: >> (define-class () >> (temp-methods :init-value '())) >> (define-method (add-method! (generic ) >> (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 and specialize functions to them is called meta object protocols, or MOPs. While the MOP for works, the MOP for 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 . 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