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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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!news2.google.com!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: 23 Sep 2004 20:19:08 -0400 Organization: Cuivre, Argent, Or Message-ID: References: <11b4d.3849$d5.30042@newsb.telia.net> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1095985161 20989 212.85.156.195 (24 Sep 2004 00:19:21 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Fri, 24 Sep 2004 00:19:21 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:4063 Date: 2004-09-23T20:19:08-04:00 kevin.cline@gmail.com (Kevin Cline) writes: > It's pretty hard to make the case that this Ada code: > > procedure Insert (Word : String) is > I : Wordcount_Maps.Iterator_Type; > B : Boolean; > type Element_Access is access all Wordcount_Maps.Element_Subtype; > > for Element_Access'Storage_Size use 0; > > function To_Access is new Wordcount_Maps.Generic_Element > (Element_Access); > > begin -- Insert > Insert (Map, To_Lower (Word), 0, I, B); > declare E : Wordcount_Maps.Element_Subtype renames To_Access > (I).all; > begin > E := E + 1; > end; > end Insert; > > is easier to understand than the corresponding C++ code: > ++concordance[word]; > > or the corresponding Perl code: > ++$count{$word}; You're kidding, right? All I need to do for the Ada code is add: procedure "+" (Word : in String) renames Insert; and the final user code is: +Word; -- -- Stephe