Newsgroups: comp.sys.mac.programmer Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!news.cs.indiana.edu!ux1.cso.uiuc.edu!midway!midway.uchicago.edu!francis From: francis@zaphod.uchicago.edu (Francis Stracke) Subject: Re: How to best do a linked list on Mac In-Reply-To: palmer@nntp-server.caltech.edu's message of 10 Jun 91 17: 04:15 GMT Message-ID: Sender: news@midway.uchicago.edu (NewsMistress) Organization: Mathematics Department, University of Chicago References: <1991Jun10.002416.5656@gn.ecn.purdue.edu> <1561@caslon.cs.arizona.edu> <13358@pt.cs.cmu.edu> <1991Jun10.170415.24845@nntp-server.caltech.edu> Date: Mon, 10 Jun 1991 21:00:34 GMT In article <1991Jun10.170415.24845@nntp-server.caltech.edu> palmer@nntp-server.caltech.edu (David Palmer) writes: >hairston@henry.ece.cmu.edu (David Hairston) writes: >>[jess@gn.ecn.purdue.edu (Jess M Holle) writes:] >>[] I now need to implement a linked list on the Mac (or similar structure) and >>[] would really appreciate a summary of the posts back then if somebody has >>[] one still. >>there is no "the solution"! it depends!! however there is no >>substitute for understanding the issues involved (i'm not trying >>to be arrogant, just helpful)!!! My favorite solution is to declare an array type, then allocate a handle to such an array, and resize it dynamically. That way you can do it with only one handle (though you may want to have an array of handles, if your records are large), and you can index into the array rather than searching the list. Credits: I got this idea from the TObjectList class in the ObjectDraw sample app of ThP 2.0. If you're using the TCL, of course, you can use CCluster or CList. -- /============================================================================\ | Francis Stracke | My opinions are my own. I don't steal them.| | Department of Mathematics |=============================================| | University of Chicago | Welcome to the Real World. Enjoy the | | francis@zaphod.uchicago.edu | show. | \============================================================================/