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-Thread: a07f3367d7,70414f56d810c10c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: discriminant questions Date: Sat, 24 Sep 2011 13:54:26 +0100 Organization: A noiseless patient Spider Message-ID: References: <9f37b726-d80b-4d24-bf3f-28a14255f7fd@s20g2000yql.googlegroups.com> <0d272f62-67d0-4905-972c-8a7e912c5531@en1g2000vbb.googlegroups.com> <148cxoyabima2.16mz6xwdph2hj.dlg@40tude.net> <01a1374f-59ab-40be-9e39-0640cb2a513d@n35g2000yqf.googlegroups.com> <1fp2o673mu9az$.d9loz1zbcl0d.dlg@40tude.net> <14tiipigyejtc$.hyp7e82egqwq$.dlg@40tude.net> <34d856bd-19a3-4bbf-b9d8-c0f100000ef4@k7g2000vbd.googlegroups.com> <1tpl2pc36ptr4$.txv4v3wmkjlm.dlg@40tude.net> <1malv6h6q31j3.uz9ws5j0glnm.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="15274"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/85puMXQpb8EdNPteD88rxszafSGKNNjY=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:txcVazymQ/fcMr7yRlnIUhRYM40= sha1:9uTCa18Z/R34b6Z6NnMmO3hQtPk= Xref: g2news2.google.com comp.lang.ada:22055 Date: 2011-09-24T13:54:26+01:00 List-Id: "Dmitry A. Kazakov" writes: > Consider a generic implementation of removing all elements of the > container using iterators: > > This := Container.First; > while This /= Null_Iterator loop > Next := This.Next; > This.Delete; > This := Next; > end loop; > > This may work or not depending on the semantics of Delete. E.g. for a > circular list, it will loop forever. I'm not sure whether to be amused by the fact that for BC.Containers.Rings (which are logically circular), which offer procedure Delete_Item_At (It : in out Ring_Iterator); you would get an exception Not_Yet_Implemented :-) Clearly no one has encountered this in practice; I don't feel especially motivated to fix it (mainly because a Ring has the concept of Top and Mark, and I don't have an intuitive grasp of what should happen to Top or Mark if either happens to be the one that's deleted!) This particular Container seems to me to be a prime example of adding a feature to a library for theoretical reasons rather than because someone has a reasonable need for it and therefore a use case. My own use of the BC containers has involved Collections (like Vectors) (plain and ordered), Maps, Queues (plain and ordered), Sets and on one occasion Bags; no Deques, Rings, Stacks, Graphs, Trees of any flavour ...