From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Clinton Ebadi (by way of Clinton Ebadi ) Newsgroups: gmane.lisp.guile.user Subject: Re: GOOPS %modify-[instance|class] Date: Sun, 19 Jan 2003 23:01:17 -0500 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <200301192301.17887.clinton@unknownlamer.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1043035088 24132 80.91.224.249 (20 Jan 2003 03:58:08 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 20 Jan 2003 03:58:08 +0000 (UTC) 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 18aT4Y-0006H6-00 for ; Mon, 20 Jan 2003 04:58:06 +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 18aT5F-0005Bw-06 for guile-user@m.gmane.org; Sun, 19 Jan 2003 22:58:49 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18aT4Z-0004Cu-00 for guile-user@gnu.org; Sun, 19 Jan 2003 22:58:07 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18aT4D-00035a-00 for guile-user@gnu.org; Sun, 19 Jan 2003 22:57:46 -0500 Original-Received: from out003pub.verizon.net ([206.46.170.103] helo=out003.verizon.net) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18aT3y-0002LP-00 for guile-user@gnu.org; Sun, 19 Jan 2003 22:57:31 -0500 Original-Received: from vsynth ([151.196.174.177]) by out003.verizon.net (InterMail vM.5.01.05.20 201-253-122-126-120-20021101) with ESMTP id <20030120035729.IYJU3094.out003.verizon.net@vsynth> for ; Sun, 19 Jan 2003 21:57:29 -0600 Original-Received: from clinton by vsynth with local (Exim 3.35 #1 (Debian)) id 18aT7e-0002RD-00 for ; Sun, 19 Jan 2003 23:01:18 -0500 User-Agent: KMail/1.4.2 Original-To: guile-user@gnu.org X-Authentication-Info: Submitted using SMTP AUTH LOGIN at out003.verizon.net from [151.196.174.177] at Sun, 19 Jan 2003 21:57:28 -0600 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:1567 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1567 On Wednesday 15 January 2003 07:38, Mikael Djurfeldt wrote: > BTW, (oop goops save) seems to do something related to what you want > to do. In fact, it does almost everything I need. I was trying to use class redefinition to handle cycles in objects by storing an object in a proxy object and then = (at the end of serialization) resolving all cycles by converting all remainin= g proxy objects into the objects they held. The save module does what my co= de used to: have each object that contains another object recieve a copy of = the object instead of a pointer to the original object (which causes problems= ). The first bug was that I was using #:init-key instead of #:init-keyword. After fixing that it doesn't explode but still doesn't work quite right.= Is there anyway to use the MOP to lazily update all instances of one class = to some unspecified second class in place? I can't see anything that would allow me to do handle recursive cycles in objects unless I integrated th= e serializer in the GC (and therefore written in C, something I do not wan= t to do). [ten minutes later] This new method works: (define-method (change-class (obj ) (new )) (format #t "change-class: ~A:~A " obj (class-of obj)) (let ((object (slot-ref obj 'object))) (%modify-instance obj (shallow-clone object)))) I changed some other stuff, but if %modify-instance is made public I can = very easily handle cycles in objects and my object serializer works (I do need= to go in and make it more efficient, but the point is that it /works/). The project that I am writing this for is supposed to be 100% Scheme, but if = I have to I'll just include a copy of %modify-instance if I have to. The on= ly problem I have is that if I try to serialize an unserialized object I get "Slot `object' is unbound in object #< [address]>" which appears to be because the class is now invalid (is there = a way to make it valid again?) -- http://unknownlamer.org _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user