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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,243dc2fb696a49cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews1.google.com!not-for-mail From: kevin.cline@gmail.com (Kevin Cline) Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: 24 Sep 2004 12:12:17 -0700 Organization: http://groups.google.com Message-ID: References: <11b4d.3849$d5.30042@newsb.telia.net> NNTP-Posting-Host: 198.23.5.11 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1096053137 12820 127.0.0.1 (24 Sep 2004 19:12:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 24 Sep 2004 19:12:17 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:4125 Date: 2004-09-24T12:12:17-07:00 List-Id: "Randy Brukardt" wrote in message news:... > "Brian May" wrote in message > news:sa4ekks60xf.fsf@snoopy.apana.org.au... > ... > > The following code (or something like it), I believe (not tested), > > should reduce the line count (and complexity) of the above: > > > > procedure Insert (Word : String) is > > I : Wordcount_Maps.Iterator_Type; > > B : Boolean; > > > > begin -- Insert > > Insert (Map, To_Lower (Word), 0, I, B); > > Replace_Element(I, Element(I) + 1); > > end Insert; > > I was going to post something similar, as update-in-place is a premature > optimization in this case. > > As far as I can tell, all this thread proves is that it would be nice if Ada > allowed redefinition of some of the operations (as opposed to operators) > like "in" and "()". And that the overriding concern for safety in Ada makes > code a bit longer. Again, the original question was "Why isn't Ada more popular?" The answer I am giving is that most programmers don't have such an overriding concern for safety that they are willing to write twice as much code to get the additional safety. > The latter is why there aren't implicit instantiations, > and why there isn't a routine like: > > function Modify_Element (Item : in Cursor) return access Element_Type; Ok, although it's not readily apparent to me why implicit instantiations are inherently unsafe. Nor do I believe reference expressions like concordance[word] are inherently unsafe. Storing the reference in a variable that may outlive the referent is unsafe, but I don't see why this is different from Ada access types.