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-Thread: 103376,f822ae7b0f7433c1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news3.google.com!news.glorb.com!proxad.net!proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Translating an embedded C algorithm From: Georg Bauhaus In-Reply-To: <1168963927.396654.169380@s34g2000cwa.googlegroups.com> References: <1168871816.263502.212100@11g2000cwr.googlegroups.com> <45ace573$1_3@news.bluewin.ch> <68qioe.mes.ln@hunter.axlog.fr> <1168963927.396654.169380@s34g2000cwa.googlegroups.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Organization: # Message-Id: <1168967445.2218.119.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Date: Tue, 16 Jan 2007 18:10:46 +0100 NNTP-Posting-Date: 16 Jan 2007 18:08:39 CET NNTP-Posting-Host: 3d0bc843.newsspool2.arcor-online.net X-Trace: DXC=ME@SLhY1ALhUoRk[hk2WalA9EHlD;3Ycb4Fo<]lROoRaFl8W>\BH3YbfGeI3He6jcdN[WAC4NYREJhb X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:8182 Date: 2007-01-16T18:08:39+01:00 List-Id: On Tue, 2007-01-16 at 08:12 -0800, Ludovic Brenta wrote: > Jean-Pierre Rosen a =C3=A9crit : > >> A question: I see all the time things like "if (.. < ..)" in C - are t= he > >> parentheses required there ? > > Yes, they are - because C has no "then" keyword. There must be somethin= g > > to tell the compiler where the expression ends... >=20 > Not to mention that the parentheses may contain several expressions > separated by the comma operator, some or all of which may have side > effects, and only the last of which actually controls the if > statement... for example: >=20 > if (a =3D 1, b =3D a, c =3D --a, (a =3D --b) =3D=3D c) { > ... > } > > Ah, the joy of obfuscated programming :) :) :) Obfuscuation in this style is quite possible in Ada, too, including side effects. This is from a legal program: if (a =3D 1, b =3D a) =3D T' (c =3D -a, (a =3D -b) =3D- c) then null; end if; Hint: the parentheses are needed :)