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,243dc2fb696a49cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!newshosting.com!nx02.iad01.newshosting.com!38.144.126.100.MISMATCH!feed5.newsreader.com!newsreader.com!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Thu, 23 Sep 2004 22:51:49 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <11b4d.3849$d5.30042@newsb.telia.net> Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: Thu, 23 Sep 2004 22:52:59 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-rOviRMLFQSZZdZEnf9xGhtvC/CDRrzdXpOU8SJXtZgKJmIovmtkHtNPUJTheC+vP+8TvqM/PAQwwANO!9zwgTzKTeFfJDW2xgEz1/amlwrs2TjN+YAD6vD/0CiVPs0snw+cw0K+AXgBr69eFwv5TjNUi1tQ3 X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.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.13 Xref: g2news1.google.com comp.lang.ada:4082 Date: 2004-09-23T22:52:59-05:00 List-Id: "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. 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; (Humm, the other reason was that 3.6(11) caused trouble -- but that's been repealed. I wonder if that decision should be revisited??) Randy.