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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1cf653444208df72 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-16 03:21:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!ailinel.cbb-automation.DE!not-for-mail From: dmitry@elros.cbb-automation.de (Dmitry Kazakov) Newsgroups: comp.lang.ada Subject: Re: ada vs. cpp Date: Tue, 16 Oct 2001 10:21:07 GMT Message-ID: <3bcbfda2.7486093@news.cis.dfn.de> References: <9pgr68$7pu1@news.cis.okstate.edu> <3bbd6287.346843109@news.cis.dfn.de> NNTP-Posting-Host: ailinel.cbb-automation.de (212.79.194.99) X-Trace: fu-berlin.de 1003227668 25218999 212.79.194.99 (16 [77047]) X-Newsreader: Forte Free Agent 1.21/32.243 Xref: archiver1.google.com comp.lang.ada:14647 Date: 2001-10-16T10:21:07+00:00 List-Id: On Tue, 16 Oct 2001 04:52:02 GMT, "David Thompson" wrote: >Dmitry Kazakov wrote : >... >> Sorry, but Ada is one of rare languages which are able to manipulate >> strings allocated on the stack. IMO strings are indeed one of Ada >> strengths, especially if you need an efficient parsing code. ... [..] Strings in COBOL, PL/1, FORTRANs etc >Perhaps you meant to say C is the only widespread 3GL >(besides arguably FORTH and maybe early BASIC?) that >_didn't_ have character strings as an "official" datatype :-? No, said that Ada has excellent strings. It is true that many languages have strings. Even FORTRAN IV arrays of LOGICAL*1 could be counted as strings (:-)). However, to have an excellent string support one should fulfil some requrements, which include IMO: 1. There are stack allocated strings 2. There are in, out, inout parameters and returns of the string type 3. The string bounds are not a part of the type 4. Bounds can be obtained from any string object 5. There are constrained string subtypes 6. String slices The rest follows. >In this area (as others) Ada did a good job of collecting, >organizing, and making uniform pretty much all the functions Yes >available in other 3GLs, but did not break significant new ground. Maybe. However, I would like to see an example of such new ground breaking. Some people here have argued that C++ has strings because one can develop them. Very well, to follow this logic I expect that there is something extr-r-r-emely important and new for strings that cannot be [efficiently] implemented in Ada 95. And? BTW did char * break something other than programmers' heads? (:-)) >Which I hasten to say is still a valuable and even vital contribution. Yes >> In any case, as many have pointed, it is a bit ridiculous to compare >> Ada's strings with C++ having no strings at all. >> >As previously noted C++ std::string is closely comparable >to Ada.Strings.Unbounded (and dynamically allocated). As I have pointed in other post I disagree with this logic. What can be expressed in the language terms is *not* a part of the language. Yes, in C++ one may have what bounded or unbounded Ada strings are. Then there are ready to use string implementations like STL or MFC. But C++ have nothing comparable with the type String in Ada. Regards, Dmitry Kazakov