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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f2690a5e963b61b6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!newscon06.news.prodigy.com!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 19 Jul 2005 21:37:41 -0500 Date: Tue, 19 Jul 2005 22:37:46 -0400 From: "Robert I. Eachus" User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) 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> <%q%Ce.11640$1Y1.7177@fe02.lga> In-Reply-To: <%q%Ce.11640$1Y1.7177@fe02.lga> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: NNTP-Posting-Host: 24.147.79.61 X-Trace: sv3-bCLVeRDA+Iou9oVzhWJSC3/eDrWwB/hPItMfsOn992vKeR3YI88pC49qBgDa87r/LjCZkuoxVcwWvVX!7J+Av+3LIHyROnt62gwmSZjGgpKAqaQqBgqUu6EjxL6G+XtzKGxel/zlHTyyIXwE3YnFDezHAGk= X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.31 Xref: g2news1.google.com comp.lang.ada:3689 Date: 2005-07-19T22:37:46-04:00 List-Id: Mikhail Terekhov wrote: > That means do it youself. So much for a "generic" library - if you need > some generic case - do it yourself. No, what you are asking for is many more standard packages. As Randy discribed in another part of this thread, the ARG worked to reduce the number of container variations that were part of the standard. In doing this there are cases where one variant supports several different abstractions. If you use the standard containers with any of those views, the packages are safe and efficient. If you mix abstractions, you either have to choose a more expensive implementation, or risk erroneousness. But it would be silly to provide half-a-dozen versions of some of the packages, one without Delete, one without cursors, one with a single cursor, and one with cursors that are always checked for validity, etc. In practice if you need these abstractions materialized, it is less than an hour's work. But most programmers don't even do that--they instantiate the package and document with a comment about how callers are expected to use the instance. Yes, violations of those comments should be treated as programming errors. It is one of the strengths of Ada that 1) you often can choose between compile time and run-time checking, and 2) you can use tools, such as SPARK, that pay attention to those comments, and validate them at compile time. To summarize this long discussion, you say you know how to program badly in Ada. I, and a lot of other people say, so do we, but we would rather not. Years, ago I remember Robert Dewar, when talking about Spitbol I think, saying that there were two possible philosophies to use when creating programming languages: Try to make it hard to do it wrong, or to try to make it easy to do things right. In Ada we aim for both, but with a third caveat, which is that it should be possible to do anything. Of course, to the maximum extent possible, we try to make doing something wrong and writing ugly code synonymous, and the same for elegant code and doing things right--from a software engineering perspective. I think this is why you keep not getting it. When someone says, this is a cleaner way to write that, and doesn't have the flaw you are worried about, they are really thinking that answers you. But you would prefer not to be allowed to write erroneous programs in Ada. Sorry, see above. It is often not easy, but it can be done. (At this point I should send you off to read G�del's Proof...)