From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ce0900b60ca3f616 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-13 08:38:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: List container strawman Date: 13 Nov 2001 11:29:01 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: <3BE29AF4.80804@telepath.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1005669099 2293 128.183.220.71 (13 Nov 2001 16:31:39 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 13 Nov 2001 16:31:39 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:16418 Date: 2001-11-13T16:31:39+00:00 List-Id: Simon Wright writes: > Stephen Leake writes: > > > "List" should be limited, to prevent non-deep copies when Element is > > an access type. > > I don't see why you would want to do this specifically? (perhaps I've > misunderstood). > > If I make a List of Bank_Account_Access whose 5th element is a pointer > to my bank account, and then make a copy of it, what would you expect > the 5th element of the new List to point to? Better not be a *copy* of > my bank account! Good example. But there are many other examples where copying a list does _not_ make sense. For example, if I have a list of controls in a GUI dialog box, and I pop up another dialog box, I want a list of _new_ controls, not the same ones. So the base list container must allow the user to control the copying process. That means either making it Limited and providing a Copy operation, or making it Controlled and providing Adjust. In either case, the user of the package must provide a Copy_Element operation that does the Right Thing. -- -- Stephe