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-01 18:20:32 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!wn14feed!worldnet.att.net!bgtnsc05-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: <1075482385.142744@master.nyc.kbcfp.com> <1%_Sb.6686$bn1.6285@nwrdny02.gnilink.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Mon, 02 Feb 2004 02:20:31 GMT NNTP-Posting-Host: 12.72.183.233 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1075688431 12.72.183.233 (Mon, 02 Feb 2004 02:20:31 GMT) NNTP-Posting-Date: Mon, 02 Feb 2004 02:20:31 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:5174 Date: 2004-02-02T02:20:31+00:00 List-Id: On Sun, 01 Feb 2004 21:55:54 +0000, Hyman Rosen wrote: > David Starner wrote: >> You won't gain knowledge by brute force, but it does permit certain >> reasoning, formal and informal, about code that you can't do if the >> language forces evaluation order. > > Sure. The compiler can say "I can pick an arbitrary order, so obviously > the programmer doesn't care what the order is." But the human can also say that. He doesn't have to worry that the programmer before him, knowing the evaluation rules, make a+b /= b+a. > It's just like in C++, > where the compiler says, "He's using this as the index, so he must know > wht he's doing." But Ada can do something about that. For this to be equivalent, you'd have to be asking for Ada to always return 0 or A(A'First) if you used an index out of range.