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-12 17:29:23 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!ppp-1-18.cvx6.telinco.NET!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: List container strawman Date: Tue, 13 Nov 2001 00:35:44 -0000 Message-ID: <9spt1h$14snic$1@ID-25716.news.dfncis.de> References: <3BE29AF4.80804@telepath.com> <3BE29BD4.10401@telepath.com> <3BE2DB99.B707D409@boeing.com> <3BE32A18.18404AD1@boeing.com> <3BE443DE.574D669C@acm.org> <3BE58FDD.E1FB1815@san.rr.com> <3bec1cbe$0$15824$626a54ce@news.free.fr> <9sib27$13aeg3$5@ID-25716.news.dfncis.de> <9sk5rn$140qdr$2@ID-25716.news.dfncis.de> <3BEDB57E.1203D638@otelco.net> <9sktgk$134npc$1@ID-25716.news.dfncis.de> <3BF01760.A21F56B3@san.rr.com> NNTP-Posting-Host: ppp-1-18.cvx6.telinco.net (212.1.156.18) X-Trace: fu-berlin.de 1005614961 38690380 212.1.156.18 (16 [25716]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: archiver1.google.com comp.lang.ada:16380 Date: 2001-11-13T00:35:44+00:00 List-Id: "Darren New" wrote in message news:3BF01760.A21F56B3@san.rr.com... > Nick Roberts wrote: > > Doing the equivalent of what my example procedure Normalize_Names did using > > inserts and deletes with an iterator would have ended up with code that was > > more difficult to program, more difficult to read, slower in execution, and > > (I think) more wasteful of memory. Showing this was the true purpose of my > > example. Admittedly, I really need to add more detail, but it's finding the > > time :-( > > Using sequences like this when the problem is expressed in terms of a > loop over all elements makes sense. Using sequences when the problem is > expressed in other forms may not. If your list is a list of characters > that you're trying to parse, for example, matching up parens or doing > reg-exp sorts of stuff (yes, I know you'd use strings) then only doing > reads *or* writes, only going in one direction doesn't make good sense. > If you have an ordered list and you want to insert an element in the > right place, copying the entire list to do so isn't very efficient. In essence, I agree, and I've devised a new proposal with bi-directional cursor operations. Hopefully I'll have this ready to send to Ted Dennison in a couple of days time, for him to kindly put on his web site. -- Best wishes, Nick Roberts