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: 103376,a00006d3c4735d70 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-26 07:22:22 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!nx02.iad01.newshosting.com!newshosting.com!newshosting.com!nx01.iad01.newshosting.com!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!uunet.MISMATCH!ash.uu.net!spool.news.uu.net!not-for-mail Date: Thu, 26 Feb 2004 10:21:28 -0500 From: Hyman Rosen User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: In-Out Parameters for functions References: <1077718871.47635@master.nyc.kbcfp.com> <54cp3095jmv8s17h63d4bjdus0tec7l7pt@jellix.jlfencey.com> <1077721343.481619@master.nyc.kbcfp.com> <1077724400.221032@master.nyc.kbcfp.com> <1077727496.631820@master.nyc.kbcfp.com> <103q2cf890pus79@corp.supernews.com> <1077744815.17965@master.nyc.kbcfp.com> <-tednUSWDcMxbqDdRVn-sw@comcast.com> In-Reply-To: <-tednUSWDcMxbqDdRVn-sw@comcast.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1077808896.804357@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1077808896 28420 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:5857 Date: 2004-02-26T10:21:28-05:00 List-Id: Robert I. Eachus wrote: > Vinzent 'Gadget' Hoefler wrote: >> What's your problem here? > That he has never read 10.2.1(18)? > Can't we just all agree that Hyman is not an Ada language expert and > doesn't want to be? ... What do we do with Mr. Hyman Rosen? For now, > I'm going to just post chapter and verse, and that Mr. Rosen's opinion > on any Ada language issue should be ignored. This particular subthread started when V'G'H stated that in C/C++ "The only difference is that unfortunately all Boolean operations happen to be sequence points here." When I asked him why this was unfortunate, he replied that the Ada if (Sqrt (x) > 5.0) and b then permitted Ada to test b first, and not call Sqrt(x) if b was false. I pointed out that unless sqrt(x) (later amended to gnurble(x)) was known to the compiler to be free of side-effects, the compiler must call it regardless of the value of b. I also pointed out that under similar circumstances if (Sqrt (x) > 5.0) and then b then would allow exactly the same optimization to be performed, i.e., b could be tested first and sqrt(x) need not be called if b is false. I assume 10.2.1(18)'s "results are not needed" allows the compiler to be as brilliant as it wants to be in determining this? In these discussions I tend to use the phrase "free of side-effects" as shorthand. I know that prgama pure subprograms are permitted to have side-effects, but that's not germane to the discussion, and I don't feel like adding "or pure" all over the place.