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-06 02:25:14 PST
Path:
archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!npeer.kpnqwest.net!news.edf.fr!not-for-mail
From: Pascal Obry
Newsgroups: comp.lang.ada
Subject: Re: ada vs. cpp
Date: 06 Oct 2001 11:15:09 +0200
Organization: Home - http://perso.wanadoo.fr/pascal.obry
Sender: obry@PASCAL
Message-ID:
References:
<9pgr68$7pu1@news.cis.okstate.edu>
<9phnic$9g5$1@nh.pace.co.uk>
<5fkv7.134136$w7.19988807@news02.optonline.net>
NNTP-Posting-Host: 163.107.131.27
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: clnews.edf.fr 1002359807 29216 163.107.131.27 (6 Oct 2001 09:16:47
GMT)
X-Complaints-To: newsadm@news.edf.fr
NNTP-Posting-Date: 6 Oct 2001 09:16:47 GMT
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.106
Xref: archiver1.google.com comp.lang.ada:13824
Date: 2001-10-06T09:16:47+00:00
List-Id:
"Mike Mohr" writes:
> C++ has a string class.
I know. Yet in C/C++ it is hard to beat
V1 : constant String := "1234567890";
V2 : constant String := "AAA" & V1 (3 .. V1'Last - 2) & "BBB";
in readability and ease of use.
I have done many text processing code in both C/C++ and Ada and from
experience I found the Ada code far more readable. There is may examples.
Another one that come to mind:
V1 : constant String := "0123/zzz";
subtype Code is Positive range 1 .. 4;
subtype Arg is Positive range 6 .. 8;
V2 : constant String := V1 (Arg) & '-' & V1 (Code);
This is not theory, I have used these kinds of code many many times. And again
I don't see how we could have a better readability !
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"