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 Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Cesar Rabak Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: Fri, 24 Sep 2004 11:54:35 -0300 Message-ID: <4154352B.7060505@acm.org> References: <11b4d.3849$d5.30042@newsb.telia.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de w1+tkq/4CqZy+S2VWnNwVAf8fWyAXbp2b7l9cxmfR4aButrbA= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: pt-br, pt Xref: g2news1.google.com comp.lang.ada:4107 Date: 2004-09-24T11:54:35-03:00 List-Id: Stephen Leake escreveu: > 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; > Stephen, I think the point Kevin is trying to make� is that "++$count{$word};" is already built in the Perl language, whereas "procedure "+" (Word : in String) renames Insert;" requires we _implement_ Insert as above. -- Cesar Rabak [1] I'm not completely agreeing, but would like to put that in another thread.