Message-ID: Organization: Knipp Medien und Kommunikation, Dortmund, Germany X-Gateway: ZCONNECT UX ius.gun.de [DUUCP BETA vom 28.07.1995], RFC1036/822 XX ius.gun.de [UNIX/Connect v0.71] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit From: rosans00@marvin.informatik.uni-dortmund.de (Thomas Rosanski) Subject: copy (clone) an object with references Date: 21 Oct 1995 07:33:40 +0000 Path: news.daimi.aau.dk!news.uni-c.dk!newsfeed.sunet.se!news00.sunet.se!sunic!news.sprintlink.net!news.ecrc.de!news.space.net!roka.net!ius.gun.de!gtnduss1.du.gtn.com!knipp!rosans00 Newsgroups: comp.lang.beta Distribution: world Lines: 42 Hello! I have tried to use the copy (clone) pattern as described in the Beta FAQ. But after useing A.copy -> C[]; the new object C had only references to NONE. the following is a part of me program: (# P: (# rows: (# next: ^rows; pointer: ^cols #); cols: (# next: ^cols; ele: @integer #); first_row: ^rows; (* init, put, get, add, sub, etc. *) copy: (# copyType: ##P; theCopy: ^P; do this (P)## -> copyType##; ©Type[] -> theCoyp[] exit theCopy #); (* end of P *) A : @P; C: ^P; do (* some init and put, so that A contains references to rows and cols and this have values *) A.copy -> C[] (* after this, the C has lost the references to the rows and cols, so that there are no longer values available *) Is there any other simple way to copy (clone) an object with references? (like the persistence store does, but I do not want to save the object A to a persistence store and restore it to C just to clone an object - this is not worth the aim *) Thomas Rosanski University Dortmund please use the following e-mail or reply to this posting in this newsgroup. email: rosans00@marvin.informatik.uni-dortmund.de german Beta page: http://sx1.hrz.uni-dortmund.de/userpages/toro/beta.html