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-01-27 11:05:10 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!chcgil2-snh1.gtei.net!news.bbnplanet.com!wn14feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail From: David Starner Subject: Re: In-Out Parameters for functions User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity. (Debian GNU/Linux)) Message-Id: Newsgroups: comp.lang.ada References: <1075159458.149886@master.nyc.kbcfp.com> <1075225041.167448@master.nyc.kbcfp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Tue, 27 Jan 2004 19:05:10 GMT NNTP-Posting-Host: 12.72.183.246 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1075230310 12.72.183.246 (Tue, 27 Jan 2004 19:05:10 GMT) NNTP-Posting-Date: Tue, 27 Jan 2004 19:05:10 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:4920 Date: 2004-01-27T19:05:10+00:00 List-Id: On Tue, 27 Jan 2004 12:37:21 -0500, Hyman Rosen wrote: > For the typical case where order > doesn't matter, adopting the new rule doesn't hurt optimization since > the compiler is always free to use its as-if license to do things in any > order it wants to. It would quite a bit of work to prove that two functions don't have side effects, especially in the face of exceptions. It could easily call for intra-unit optimizations, and many cases just won't be possible. > You are arguing that for the convenience of compiler vendors, > programmers should be subjected to a gratuitous source of > non-portability, which they must avoid by being careful when they code, > rather than having the language protect them. Oddly enough, this is the > attitude that Ada proponents are always denigrating about C++. Ada usually protects programmers by making things illegal, in the sake of clarity, rather then adding rigid rules. In a practical sense, the only times when the order of execution of f(x) + g(x) matters is when there's tight hidden coupling. Ada usually discourages tight hidden coupling; why make a rule whose only goal is to make it easier to do? (Yes, I know about the random case, but by definition, programmers can't depend on the results of a random function, and I think that includes the same program compiled with different optimization settings.)