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!hwmnpeer01.lga!hwmedia!hw-filter.lga!fe02.lga.POSTED!53ab2750!not-for-mail From: Mikhail Terekhov User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, 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> <1121573057.159416.274980@g49g2000cwa.googlegroups.com> <1121622050.676894.246740@g14g2000cwa.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <%q%Ce.11640$1Y1.7177@fe02.lga> X-Trace: ejlmlnpfppkfdeplnlcfplcgkbbdghlhfecgfocpabekdojmlkofpbhdcomdnfbnkocbaabgcpdeoapbkgngfglkbnbokccpokjlgbkgmachabmcjbkgbeppdmpanglfbcfagklmibllijll NNTP-Posting-Date: Mon, 18 Jul 2005 21:36:11 MST Date: Tue, 19 Jul 2005 00:36:20 -0400 Xref: g2news1.google.com comp.lang.ada:3670 Date: 2005-07-19T00:36:20-04:00 List-Id: Matthew Heaney wrote: > "Dmitriy Anisimkov" writes: > > >>I understand that using of cursors allows to reduce the number of >>routines in the Ada.Cursors. But i'm sure that using a much more >>routines without cursors would reduce a potential errors at design >>time. > > > You must adduce evidence for this claim. Otherwise we're just debating > religion. > The evidence is pretty obvious. Ada.Containers contains a set of abstractions some of which are very specialized (ordered sets and hashes), mix abstraction and implementation (hashed sets) and mix everything in one place (cursors; they even replace container abstraction itself in a number of operation). May be the implementation of these abstractions is perfect, but using such a "non rectangular briks" to design a program will be prone to abstractions misuse and hence to design errors. > > >>Using the *checking* cursors would move error detection into the run >>time. > > > Yes, but in your original example, you were complaining about a run-time > error. That error is detectable. > Not using this special case abstraction (Cursor) in general part of the library would exclude this kind of errors completely. > > >>So, I know that i could build whatever i need on top of routines with a >>cursors. > > > Yes, but that's the point. A general-purpose library must be flexible > enough to meet the needs of disparate applications. If you want the Great, to satisfy a common need, users should build a layer on top of such a "general library". > library to be strictly key-based (sans cursors), then it's far less > flexible, and no longer a general-purpose library. That depends on the definition of "general-purpose" of course. >>But I think that Ada standard should try to move design process into >>the way where the errors would be avoided at the design time. Exactly. > > You want to legislate behavior for everyone. This is wrong. You should > only be concerned with your own behavior. I unerstand this as "shut up and go away". This is not polite. Try to apply the above three sentences to yourself. > > If you want only key-based operations, then you can just write a layered > abstraction once, and you can use it everywhere. > That means do it youself. So much for a "generic" library - if you need some generic case - do it yourself.