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 From: Brian May Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) References: <11b4d.3849$d5.30042@newsb.telia.net> Date: Fri, 24 Sep 2004 09:05:48 +1000 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:bokYj1Slmgq1os+N3NNIAXFEh6M= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: dsl-202-173-153-89.vic.westnet.com.au X-Trace: news.melbourne.pipenetworks.com 1095980738 202.173.153.89 (24 Sep 2004 09:05:38 +1000) X-Complaints-To: abuse@pipenetworks.com X-Abuse-Info: Please forward all headers to enable your complaint to be properly processed. Path: g2news1.google.com!news2.google.com!news.maxwell.syr.edu!news.mel.connect.com.au!news.alphalink.com.au!news.melbourne.pipenetworks.com!not-for-mail Xref: g2news1.google.com comp.lang.ada:4058 Date: 2004-09-24T09:05:48+10:00 List-Id: >>>>> "Kevin" == Kevin Cline writes: Kevin> It's pretty hard to make the case that this Ada code: Kevin> procedure Insert (Word : String) is Kevin> I : Wordcount_Maps.Iterator_Type; Kevin> B : Boolean; Kevin> type Element_Access is access all Wordcount_Maps.Element_Subtype; Kevin> for Element_Access'Storage_Size use 0; Kevin> function To_Access is new Wordcount_Maps.Generic_Element Kevin> (Element_Access); Kevin> begin -- Insert Kevin> Insert (Map, To_Lower (Word), 0, I, B); Kevin> declare E : Wordcount_Maps.Element_Subtype renames To_Access Kevin> (I).all; Kevin> begin Kevin> E := E + 1; Kevin> end; Kevin> end Insert; 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; -- Brian May