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 %modify-[instance|class] Date: Fri, 10 Jan 2003 11:12:02 +0100 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: References: <200301082151.59431.clinton@unknownlamer.org> Reply-To: djurfeldt@nada.kth.se NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1042193531 25179 80.91.224.249 (10 Jan 2003 10:12:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 10 Jan 2003 10:12:11 +0000 (UTC) Cc: guile-user@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 18Ww8x-0006XY-00 for ; Fri, 10 Jan 2003 11:12:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Ww9S-000890-08 for guile-user@m.gmane.org; Fri, 10 Jan 2003 05:12:34 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18Ww96-00088h-00 for guile-user@gnu.org; Fri, 10 Jan 2003 05:12:12 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18Ww92-00083E-00 for guile-user@gnu.org; Fri, 10 Jan 2003 05:12:11 -0500 Original-Received: from kvast.blakulla.net ([213.212.20.77]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Ww91-0007ze-00 for guile-user@gnu.org; Fri, 10 Jan 2003 05:12:07 -0500 Original-Received: from barbara.blakulla.net ([213.212.21.238] helo=linnaeus) by kvast.blakulla.net with esmtp (Exim 3.36 #1 (Debian)) id 18Ww8y-0004l0-00; Fri, 10 Jan 2003 11:12:04 +0100 Original-Received: from mdj by linnaeus with local (Exim 3.36 #1 (Debian)) id 18Ww8w-0003wn-00; Fri, 10 Jan 2003 11:12:02 +0100 Original-To: Clinton Ebadi In-Reply-To: <200301082151.59431.clinton@unknownlamer.org> (Clinton Ebadi's message of "Wed, 8 Jan 2003 21:51:59 -0500") User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu) Original-cc: djurfeldt@nada.kth.se X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: General Guile related discussions List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:1520 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1520 Clinton Ebadi writes: > I think %modify-instance and -class should be public. Could you be more specific why? These seem pretty strange and magical to me, and might change as the implementation evolves... > I specialized change-class and change-object-class (to the same > thing, just to be safe because the manual says either one may be > called but not both). The manual shouldn't mention change-object-class since that is a private part of the implementation. BTW, change-class is a generic function while change-object-class is a prociedure. > I seem to have a problem: when I return the updated class, all my > pointers to the old class are invalidated! And then it seems that > GOOPS continues in an infinite loops updated the same objects over > and over again. Could you please explain what you want to do. You talk about returning an updated class. But this only happens if one is using change-class to change the metaclass of a class instance. The normal job for change-class is to change the class of an instance. Here's an example of specialization to change-class: (define-class ()) (define-method (change-class (o ) (c )) (next-method) (format #t "class changed for instance ~A\n" o)) (define-class c () (x) #:metaclass ) (define o (make c)) ;;; Now we redefine c: (define-class c () (x) (y) #:metaclass ) ;;; If we now refer to o, it will be lazily updated: o --> class changed for instance # # This seems to work. Could you please give me enough information to reproduce the infinite loop you are talking about? Best regards, Mikael Djurfeldt _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user