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: f849b,b8d52151b7b306d2 X-Google-Attributes: gidf849b,public X-Google-Thread: 103376,a00006d3c4735d70 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-31 05:38:49 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!cyclone1.gnilink.net!spamkiller2.gnilink.net!nwrdny01.gnilink.net.POSTED!c2bfcbcf!not-for-mail Subject: Re: Certified C compilers for safety-critical embedded systems Newsgroups: comp.arch.embedded,comp.lang.ada 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> Message-ID: From: Ed Falis Content-Type: text/plain; format=flowed; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit User-Agent: Opera7.23/Linux M2 build 518 Date: Wed, 31 Dec 2003 13:38:48 GMT NNTP-Posting-Host: 151.203.254.6 X-Complaints-To: abuse@verizon.net X-Trace: nwrdny01.gnilink.net 1072877928 151.203.254.6 (Wed, 31 Dec 2003 08:38:48 EST) NNTP-Posting-Date: Wed, 31 Dec 2003 08:38:48 EST Xref: archiver1.google.com comp.arch.embedded:6434 comp.lang.ada:3983 Date: 2003-12-31T13:38:48+00:00 List-Id: On Wed, 31 Dec 2003 00:11:37 GMT, Dave Hansen wrote: > Though structurally, this reminds me of > > while (1) /* or for (;;) if you like obscure syntax */ > { > key = get_key(); > if (key == EXIT_KEY) break; > process(key); > } > > which tends to be discouraged. 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. > > Another question: Note that in C, even though get_key takes no > parameters, it is called with empty parentheses, while Get_Key in Ada > looks (syntactically) like any other variable. ISTR that in Modula-2, > a function that takes no paramters could be called either way (with or > without empty parentheses). Is this true in Ada? FWIW, I like the > empty parens because they signal to the reader that something special > is going on. 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. - Ed