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,a644fa9cd1a3869a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-13 13:30:39 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!europa.netcrusader.net!usenetserver.com!208.184.7.66!newsfeed1.cidera.com!Cidera!cyclone1.gnilink.net!news-east.rr.com!news-west.rr.com!lsnws01.we.mediaone.net!typhoon.san.rr.com!not-for-mail Message-ID: <3BF19106.5FF19B59@san.rr.com> From: Darren New Organization: Boxes! X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: List container: Insert and Delete References: <9sn4qm$13g29j$2@ID-25716.news.dfncis.de> <9sok8i$142am0$2@ID-25716.news.dfncis.de> <3BF004F4.F74AE461@boeing.com> <9sp5up$g5o$1@nh.pace.co.uk> <3BF0827A.DCF2213C@acm.org> <9sra40$b8p$1@nh.pace.co.uk> <5DaI7.23016$xS6.35866@www.newsranger.com> <3BF15C70.B7EF23E6@san.rr.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 13 Nov 2001 21:31:05 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: typhoon.san.rr.com 1005687065 66.75.151.160 (Tue, 13 Nov 2001 13:31:05 PST) NNTP-Posting-Date: Tue, 13 Nov 2001 13:31:05 PST Xref: archiver1.google.com comp.lang.ada:16457 Date: 2001-11-13T21:31:05+00:00 List-Id: Ted Dennison wrote: > >For example, I strongly suggest that there be a mechanism to translate > >between positions and integer offsets and back. This is an O(N) > >operation, obviously, compared to the O(1) of moving the position. > > You had me, before you presented this example. :-) I don't follow. What's unreasonable about the example? It seems like a perfectly reasonable way of saying "does this come before that in the list", or saving positions to a stream, or printing something out for debugging, or whatever. Saying "we're not going to implement this operation because it's inefficient" doesn't sound like a good idea to me, is all. > >Then you need some way to map a "pos" onto something you can save, and > >something to map it back. For example, if you're implementing Streams, > >you'll need something like this anyway, yes? > If you are implementing them for positions, which we currently are not (check > the spec). That could just be an oversight, though. Someone will want to save positions. There's three choices: implement positions for streams, provide ways to convert to something simpler (like Integer), or force the person who wants that to keep track of the integer as well as the position or to implement the run-through-the-list somehow (assuming positions have equality defined to start with). I vote for anything except the latter. It would be nice to be able to be able to print out the indicies and values of a list for debugging, however. -- Darren New San Diego, CA, USA (PST). Cryptokeys on demand. You will soon read a generic fortune cookie.