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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,25aa3c7e1b59f7b5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-04 06:30:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!dfw-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3C35BC5E.179671B9@spamcop.net> From: Wes Groleau Reply-To: wesgroleau@spamcop.net X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en,es-MX,es,pt,fr-CA,fr MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: A case where Ada defaults to unsafe? References: <3C34BF2C.6030500@mail.com> <3C34C11F.DE91C451@san.rr.com> <3C34CECF.9060403@mail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 04 Jan 2002 09:29:50 -0500 NNTP-Posting-Host: 151.168.144.162 X-Complaints-To: news@ext.ray.com X-Trace: dfw-service2.ext.raytheon.com 1010154600 151.168.144.162 (Fri, 04 Jan 2002 08:30:00 CST) NNTP-Posting-Date: Fri, 04 Jan 2002 08:30:00 CST Organization: Raytheon Company Xref: archiver1.google.com comp.lang.ada:18520 Date: 2002-01-04T09:29:50-05:00 List-Id: Hyman Rosen wrote: > > Darren New wrote: > > > Hyman Rosen wrote: > >>So in Ada, one could say 'if a /= 0 and b/a > 3' and fall into a > >>trap that would not happen in C/C++. Discuss? > > Or, in C, you could say > > if (func_with_side_effects(1) || func_with_side_effects(2)) {...} > > and also not get the answer you might expect. > > It would be the answer *I* expect :-) In Ada, the answer would be > indeterminate as well if the order of the side effects mattered. Personally, I agree with the AQS philosophy: If the order of evaluation matters, the code should show that. And if it doesn't matter, then nothing implying that it does matter should clutter up the code. Requiring the compiler to do a particular order, even if it doesn't matter conceptually, is preventing the compiler from optimizing the order when it affects efficiency. (And requiring people to use "and then" all the time also interferes with the optimizer, as well as adding misleading clutter to the code.) On the other hand, there's something to be said for determinism. -- Wes Groleau http://freepages.rootsweb.com/~wgroleau