From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: goops and memoization Date: 21 Nov 2002 23:50:20 +0000 Sender: guile-devel-admin@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1037923744 13037 80.91.224.249 (22 Nov 2002 00:09:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 22 Nov 2002 00:09:04 +0000 (UTC) Cc: Dirk Herrmann , guile-devel@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18F1NW-0003O6-00 for ; Fri, 22 Nov 2002 01:09:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18F1Gt-0002L7-00; Thu, 21 Nov 2002 19:02:11 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18F1Gd-0002Ax-00 for guile-devel@gnu.org; Thu, 21 Nov 2002 19:01:55 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18F1Gb-00029l-00 for guile-devel@gnu.org; Thu, 21 Nov 2002 19:01:55 -0500 Original-Received: from mail.uklinux.net ([80.84.72.21] helo=s1.uklinux.net) by monty-python.gnu.org with esmtp (Exim 4.10) id 18F1Gb-00029h-00 for guile-devel@gnu.org; Thu, 21 Nov 2002 19:01:53 -0500 Original-Received: from laruns.ossau.uklinux.net (bts-0624.dialup.zetnet.co.uk [194.247.50.112]) by s1.uklinux.net (8.11.6/8.11.6) with ESMTP id gAM01or03167; Fri, 22 Nov 2002 00:01:50 GMT Original-Received: from laruns.ossau.uklinux.net.ossau.uklinux.net (localhost [127.0.0.1]) by laruns.ossau.uklinux.net (Postfix on SuSE Linux 7.2 (i386)) with ESMTP id ED88ADC131; Thu, 21 Nov 2002 23:50:20 +0000 (GMT) Original-To: djurfeldt@nada.kth.se In-Reply-To: Original-Lines: 28 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:1738 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1738 >>>>> "Mikael" == Mikael Djurfeldt writes: Mikael> (An alternative solution is to implement compile-method in Mikael> C, memoizing the source code while walking through it. In Mikael> fact, that could mean that we don't need to call Mikael> procedure-source => no need to unmemoize code.) A further possibility occurs to me - transforming the method definition at define-method time something like this: (define-macro (make-method gf specializers formals . body) `(letrec ((m (lambda ,formals (define (next-method) (call-next-method ,gf ,specializers m ,@formals)) ,@body))) m)) Given the gf and specializers, call-next-method works out a list of applicable methods (probably cached) in the same way as for a normal gf application, then it looks through this list for m and applies the method after m to the supplied arguments (formals). Would this kind of approach work? Neil _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel