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,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!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: <874pqqd2ly.fsf@ludovic-brenta.org> 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> <1168967445.2218.119.camel@localhost> <874pqqd2ly.fsf@ludovic-brenta.org> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: # Message-ID: <1169065373.2218.155.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Date: Wed, 17 Jan 2007 21:22:53 +0100 NNTP-Posting-Date: 17 Jan 2007 21:20:39 CET NNTP-Posting-Host: eca5c63e.newsspool2.arcor-online.net X-Trace: DXC=NY>VYHRKhcmEB;5>eE0T7mA9EHlD;3Ycb4Fo<]lROoRaFl8W>\BH3YbNhW=8PdbJZ`N[W On Tue, 2007-01-16 at 23:32 +0100, Ludovic Brenta wrote: > Georg Bauhaus writes: > >On Tue, 2007-01-16 at 08:12 -0800, Ludovic Brenta wrote: > [...] > >> if (a = 1, b = a, c = --a, (a = --b) == 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 = 1, b = a) = T' (c = -a, (a = -b) =- c) then > > null; > > end if; > > > > Hint: the parentheses are needed :) > > Including the side effects? All I see are two aggregates for a > hypothetical "type T is array (Positive range <>) of Boolean", but > where are the assignments to a, b and c? And where are the decrements > of a and b? The assignments happen in the body of function "-"(x: Integer) return Boolean; which is defined at the same level as a, b, and c.