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: 103376,f2690a5e963b61b6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!news.germany.com!newsfeed.arcor.de!news.arcor.de!not-for-mail Date: Wed, 06 Jul 2005 10:02:24 +0200 From: Georg Bauhaus Organization: future apps GmbH User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Debian/1.7.8-1 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: GCC 4.0 Ada.Containers Cursor danger. References: <1120474891.635131.216700@g44g2000cwa.googlegroups.com> <1120575076.876798.108220@g44g2000cwa.googlegroups.com> <1120583470.429264.325450@g43g2000cwa.googlegroups.com> <1120633337.871534.305480@g43g2000cwa.googlegroups.com> In-Reply-To: <1120633337.871534.305480@g43g2000cwa.googlegroups.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <42cb9003$0$22761$9b4e6d93@newsread2.arcor-online.net> NNTP-Posting-Date: 06 Jul 2005 10:02:11 MEST NNTP-Posting-Host: 80ba48f5.newsread2.arcor-online.net X-Trace: DXC=>A=kRfn:0BmGnN95NbAh:aQ5U85hF6f;djW\KbG]kaMhU7^]5?JhlBn`F0@kn0Cb[bUUng9_FXZ=c>:=P9Ihe`Bh@Z?dZ]MOide X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:11881 Date: 2005-07-06T10:02:11+02:00 List-Id: Dmitriy Anisimkov wrote: > I think that safety is a good feature even for the regular > applications. It would help to reduce debugging time > > Matthew told: > <> > > I think that containers without cursors could loose some flexibility, > but do not loose functionality and performance. If you remove cursors, like for example from Insert/4, then you will definitly have algorithms that will run more slowly using more memory cells or register cells. This is because cursors on dynamic containers work to achieve some efficiency. It's worthwhile to read up on the AI 302. I'm assuming you somehow found a way around the case where you have to compare strings and/or hash them in order to repeatedly find a key? Or how do you remember a position in a dynamic container? Using a cursor, certainly O(1) is less than O(hashing + string comparisons)? And how do you _not_ loose efficiency if on every loop iteration you check the validity of your variables related to container elements? > And definately gaining > in safety and in the debugging time. You are gaining exceptions in some cases. If there were a number of generic algorithms working on top of Ada.Containers, would they be useful in your work? How about idiomatic uses of the library? Georg