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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dab7d920e4340f12 X-Google-Attributes: gid103376,public From: guerby@gnat.com (Laurent Guerby) Subject: Re: C is 'better' than Ada because... Date: 1996/07/17 Message-ID: #1/1 X-Deja-AN: 168629805 sender: guerby@schonberg.cs.nyu.edu references: organization: New York University reply-to: guerby@gnat.com newsgroups: comp.lang.ada Date: 1996-07-17T00:00:00+00:00 List-Id: Oliver> Electing at random one of many issues, I generally find string Oliver> processing in C less tedious than Ada83. One of the rare occasions Oliver> where the beauty of Ada83 strings showed was this: Oliver> Oliver> function Replicate (C : Character; Times : Positive) return String is Oliver> Buffer : String(1..Times) := (others => C); Oliver> begin Oliver> return Buffer; Oliver> end Replicate; What about the very simple Times * Character See RM95-A.4.3(105). Note that a Replicate function is language defined in Ada 95, and that, according to the context, the given expression can be a String (Ada 83), a Bounded_String (a la Pascal, max length given) or an Unbounded_String (Ada 95, possibly "infinite" length and "garbage collected"). See also the good article by Richard Rielhe on String handling in Ada 95 in a recent JOOP issue. I cannot seriously believe that someone saying that C String handling is more elegant than Ada one is not trolling ;-). -- Laurent Guerby , Team Ada. "Use the Source, Luke. The Source will be with you, always (GPL)."