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!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread2.news.atl.earthlink.net.POSTED!14bb18d8!not-for-mail Sender: mheaney@MHEANEYX200 Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) References: From: Matthew Heaney Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 24 Sep 2004 13:47:52 GMT NNTP-Posting-Host: 64.185.133.124 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.atl.earthlink.net 1096033672 64.185.133.124 (Fri, 24 Sep 2004 06:47:52 PDT) NNTP-Posting-Date: Fri, 24 Sep 2004 06:47:52 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:4103 Date: 2004-09-24T13:47:52+00:00 List-Id: Georg Bauhaus writes: > Kevin Cline wrote: [body of Insert snipped] > : ++concordance[word] > : or > : ++$count{$word} ? > > Isn't the comparison at different levels? AI 302 is to be minimal, I > think, in that every convenient operation can be built from thingies > present in Ada.Containers. Yes, that's exactly right. Which is why the comparison above should really be: Insert (Word); or ++concordance[word] or ++$count{$word} Comparing the one-line C++ and Perl statements to the body of the Insert subprogram defeats the purpose of writing the subprogam! And the reason why we have to write the subpgram is because Ada doesn't give you any direct way of returning a reference to variable view from a function, as C++ does. But even so, in Ada you can modify objets in place (in AI-302 by using a downward closure -- which C++ doesn't have). That's what really matters, not the syntax. -Matt