Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!deimos.cis.ksu.edu!uxc!uxc.cso.uiuc.edu!m.cs.uiuc.edu!p.cs.uiuc.edu!johnson From: johnson@p.cs.uiuc.edu Newsgroups: comp.lang.smalltalk Subject: Re: Saving recursive lists to files in Message-ID: <80500060@p.cs.uiuc.edu> Date: 8 May 89 14:32:00 GMT References: <820@sunkisd.CS.Concordia.CA> Lines: 11 Nf-ID: #R:sunkisd.CS.Concordia.CA:820:p.cs.uiuc.edu:80500060:000:571 Nf-From: p.cs.uiuc.edu!johnson May 8 09:32:00 1989 storeOn: does not work for circular data structures, because it tries to do a depth-first traversal of the data structure. You have to write a special version of storeOn: for recursive objects. The general idea is to write a storeOn:using: method that also takes a dictionary as an argument. The dictionary maps each component of the structure to a name. The component is only written out once, but its name can be used many times. Steve Vegdahl had a nice article explaining this in OOPSLA'86, and Tektronix versions of Smalltalk include his more general solution.