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,1d321b3a6b8bcab2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-24 21:57:56 PST Path: nntp.gmd.de!newsserver.jvnc.net!yale.edu!yale!zip.eecs.umich.edu!newsxfer.itd.umich.edu!gatech!swrinde!pipex!uunet!gwu.edu!seas.gwu.edu!dobrien From: dobrien@seas.gwu.edu (David O'Brien) Newsgroups: comp.lang.ada Subject: Re: "Subtract C, add Ada" Date: 25 Jan 1995 05:57:56 GMT Organization: George Washington University Message-ID: <3g4p94$g07@cronkite.seas.gwu.edu> References: <3fo2ot$su2@miranda.gmrc.gecm.com> <1995Jan23.154631.6702@sei.cmu.edu> NNTP-Posting-Host: 128.164.9.3 X-Newsreader: TIN [version 1.2 PL2] Date: 1995-01-25T05:57:56+00:00 List-Id: Robert Firth (firth@sei.cmu.edu) wrote: : LOOP : get(c); : EXIT WHEN c /= ASCII.SP; : END LOOP; : Note also that if there are *no more* non space characters, the C code : dies in an infinite loop, while the Ada code automatically does the : right thing, namely raises the END_ERROR exception. Woa! Just how is it going to be determined that "enough" spaces have been processed before it is decided that we have an infinate loop? I'm not too sure I want some compiler/run-time to decide it has had enough and kill my program... -- David O'Brien (dobrien@seas.gwu.edu) : >OK, its no big thing to write: : > : > P(I) := Q(I); : > I := I + 1; : > : >instead of : > : > *p++ = *q++; : > : >but I actually *do* find the C representation easier/better etc. (perhaps : >I'm wierd?) : Again, I don't see it. The Ada code makes it clear that *corresponding* : elements of the array Q are being copied into P - though, of course, : a real Ada programmer (TM) would have written just P := Q. The C code : doesn't make that clear - you're going to have to ferret out the : initialisations of p and q to determine that. And if you worry about : the correctness of the copy - for instance, whether P and Q are the : same size - that's surely going to be a lot easier to establish in Ada.