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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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!postnews1.google.com!not-for-mail From: kevin.cline@gmail.com (Kevin Cline) Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: 27 Sep 2004 07:31:44 -0700 Organization: http://groups.google.com Message-ID: References: <41547dae$0$91007$39cecf19@news.twtelecom.net> NNTP-Posting-Host: 24.1.141.253 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1096295504 1971 127.0.0.1 (27 Sep 2004 14:31:44 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 27 Sep 2004 14:31:44 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:4270 Date: 2004-09-27T07:31:44-07:00 List-Id: Matthew Heaney wrote in message news:... > kevin.cline@gmail.com (Kevin Cline) writes: > > > > > One of the most frustrating things I found in Ada programming was the > > inability to make user-defined types work like the built-in types. > > Given > > > > A: array (1..10) of integer; > > > > then the expression A(5) is a modifiable reference to the fifth > > element of A. > > > > After experience with C++ it was amazingly frustrating to learn that > > there was no way I could define My_Container so that I could write: > > > > C: My_Container ; > > > > C(5) := 7; > > > Indeed, you cannot do this. In AI-302 (and in Ada.Strings.*), you have to say: > > Replace_Element (C, Index => 5, By => 7); I think this was a major error in the language design. As a result it very tedious to write a generic that will work with both predefined and user-defined types.