Path: news.daimi.aau.dk!news.uni-c.dk!newsfeed.sunet.se!news00.sunet.se!sunic!news.sprintlink.net!wizard.pn.com!Germany.EU.net!Dortmund.Germany.EU.net!Informatik.Uni-Dortmund.DE!marvin!rosans00 From: rosans00@marvin.informatik.uni-dortmund.de (Thomas Rosanski) Newsgroups: comp.lang.beta Subject: copy (clone) of objects with references ? Date: 23 Oct 1995 12:38:50 GMT Organization: CS Department, University of Dortmund, Germany Lines: 47 Message-ID: <46g2cq$401@fbi-news.Informatik.Uni-Dortmund.DE> NNTP-Posting-Host: marvin.informatik.uni-dortmund.de Summary: problem to copy (clone) object with reference attributes Keywords: copy, clone, object, references X-Newsreader: TIN [version 1.2 PL2] I have tried to use the copy (clone) pattern, as described in the Beta FAQ. But I have problems to get a copy, that has references to identic objects, which should also be generated new. (if you do not understand me english, just take a look of me program code:) (# mat: (# rows: (# next: ^rows; pointer: ^cols; index: @integer; #); cols: (# next: ^cols; ele: @integer; index: @integer; #); begin: ^rows; (* some attributes like init, add, mult, ... *) copy: (# (* as suggested in the BETA faq *) #); #); (* end of mat *) A: @ mat; B: ^ mat; do (* some inits, filling A with references to rows, cols and setting integer values *) A.copy -> B[]; (* trying to clone the object A *) #) After A.copy -> B[]; B has the same pattern strukture like A, but the references next[] and pointer[] are NONE. So me question: Is there an easy way to copy (clone) an object, that contains refernce attributes? (I think, it is possible via the persistent store - storing A to a persistent store and restore the content of the persistent store to B - but this seems to use much time). greetings... -- ___ Thomas Rosanski rosans00@marvin.informatik.uni-dortmund.de / \____________ _ / /\_)___________) you can find me on the web with german languange ()_____) texts about the internet, the programming languange ()_____) Beta, my pgp code, a pic of myself and many more: --\___()_____) http://sx1.hrz.uni-dortmund.de/userpages/toro/toro.html