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!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: Mon, 27 Sep 2004 10:12:18 +0200 Message-ID: References: <13bv1aau5q9ht.1fr6ixcdql72.dlg@40tude.net> <1219289.a4UNLEWChh@linux1.krischik.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de tR+04L0ZNb0cCNje5nNVjAfmw2hRHX8IUkb/MzIq+h2MHzwp4= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:4246 Date: 2004-09-27T10:12:18+02:00 List-Id: On Sat, 25 Sep 2004 16:17:34 +0200, Martin Krischik wrote: > Dmitry A. Kazakov wrote: > >> On Fri, 24 Sep 2004 13:47:52 GMT, Matthew Heaney wrote: >> >>> 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. >> >> Syntax does not matter. What matters is an ability to express an idea in >> the syntax you want. To me, the most natural syntax for modifying an array >> element is A(I) := B; > > True. But only if it works. I just had some fun reading the fineprint from > std::vector::operator [] (can not insert new elements - and at least the MS > version crashes deep inside library code when you try) and > std::map::operator [] (no const version). If it does not work as expected I > rather live without and use an Insert () which then does work as expected. Insert is another story. Whether array indexing should be used for inserting new elements is questionable. Anyway, Ada lacks abstract arrays, abstract indices and many other things, including an ability to return a safe referential cursor as Matthew has pointed, essential for building a safe, intuitive container library. Also in my deep opinion that library should not be generic. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de