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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f849b,b8d52151b7b306d2 X-Google-Attributes: gidf849b,public X-Google-Thread: 103376,a00006d3c4735d70 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-31 07:22:20 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!newshosting.com!nx02.iad01.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 31 Dec 2003 09:22:18 -0600 Date: Wed, 31 Dec 2003 10:22:18 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.arch.embedded,comp.lang.ada Subject: Re: Certified C compilers for safety-critical embedded systems References: <3fe00b82.90228601@News.CIS.DFN.DE> <3FE026A8.3CD6A3A@yahoo.com> <3bf1uvg2ntadvahfud2rg6ujk24sora6gr@4ax.com> <2u3auvogde8ktotlaq0ldiaska3g416gus@4ax.com> <20619edc.0312221020.3fd1b4ee@posting.google.com> <20619edc.0312222106.3b369547@posting.google.com> <45cs9hAbLc6$EAAx@phaedsys.demon.co.uk> <3fe9f0d7.104475725@News.CIS.DFN.DE> <5802069.JsgInS3tXa@linux1.krischik.com> <1072464162.325936@master.nyc.kbcfp.com> <1563361.SfB03k3vvC@linux1.krischik.com> <11LvOkBBXw7$EAJw@phaedsys.demon.co.uk> <3ff0687f.528387944@News.CIS.DFN.DE> <1086072.fFeiH4ICbz@linux1.krischik.com> <3ff18d4d.603356952@News.CIS.DFN.DE> <1731094.1f7Irsyk1h@linux1.krischik.com> <3ff1b8ef.614528516@News.CIS.DFN.DE> <3ff21255.637418757@News.CIS.DFN.DE> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <3OCdnR1Hv5k2dG-iRVn-sw@comcast.com> NNTP-Posting-Host: 24.34.214.193 X-Trace: sv3-cVeoixO3N93NcFB2+39mdgbxf4N1P2G3oL/2KNCw1p+2vtEVnHphxxtajhm9M0JOE44Ft3MRI4IM814!hAkE3EFufaKscCZgQFCDxSM+AJ9+9jMJgtOqrQzZD+W+OU/oguvaTtfiJGV+Wg== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.arch.embedded:6443 comp.lang.ada:3991 Date: 2003-12-31T10:22:18-05:00 List-Id: Ed Falis wrote: > This is a matter of language-specific idioms, I'd say. The exit from > the statement list of a loop is the most flexible Ada iteration form, > but it isn't used all that often - the other forms are more common since > they cover most cases. Depends on your programming style (and the type of programs you write) how often it occurs. I always use it for "n and a half" type loops, and for tasks where the main body is a loop that is only exited in special circumstances. Certainly in Ada, such loop are not discouraged, although some people get bent out of shape if you have two exits in a loop. I certainly am not going to get upset, or even be mildly concerned about: loop Input := Next_Char; exit when Input = 'X'; exit when Input = 'x'; Process_Input; end loop; vs. loop Input := Next_Char; exit when Input = 'X' or else Input = 'x'; Process_Input; end loop; In fact I slightly prefer the first form. > The empty parens are not allowed in Ada. Bob Eachus or someone else > might be able to give some of the rationale. It's a case similar to the > choice of () for array indexing rather than []. In Ada, a function > result is considered conceptually similar to a constant, as are > enumeration literals, and many of the same rules apply to them and their > use. I suspect the syntax is intended to reinforce this. There was a time when the parenthesis were required. I think it made it from Preliminary Ada into Ada 80, but definitely was gone before Ada 82. The argument against the empty parentheses was mostly stylistic, but the equivalence of enumeration and other literals to function calls was the real killer. A rule that determine when the empty parentheses were required was considered to be a burden on users, but it also would have been a burden on implementors and the ARG. ;-) Incidently there are a few cases in Ada where a function result is equivalent to a variable not a constant. Read about return by reference for more details. And of course you can have cases where a function returns an access value, and can appear in a name on the left hand side of an assignment statement: function Predecessor(Node: Item_Access) return Item_Access; ... Temp, New_Node: Item_Access; ... New_Node.Next := Temp; Predecessor(Temp).Next := New_Node; Of course, this is a much more common use of functions in variable names than return by reference functions. -- Robert I. Eachus "The war on terror is a different kind of war, waged capture by capture, cell by cell, and victory by victory. Our security is assured by our perseverance and by our sure belief in the success of liberty." -- George W. Bush