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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-03 08:26:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc52.ops.asp.att.net.POSTED!not-for-mail Message-ID: <3EDCBDF4.1050900@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X References: <6a90b886.0305262344.1d558079@posting.google.com> <3ED41344.7090105@spam.com> <3ED46D81.FF62C34F@0.0> <3ED46E07.4340CABC@0.0> <3ED4F3FD.A0EF7079@alfred-hilscher.de> <6vWcnTWjF83bD0qjXTWcpA@gbronline.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.62.164.137 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc52.ops.asp.att.net 1054653973 24.62.164.137 (Tue, 03 Jun 2003 15:26:13 GMT) NNTP-Posting-Date: Tue, 03 Jun 2003 15:26:13 GMT Organization: AT&T Broadband Date: Tue, 03 Jun 2003 15:26:13 GMT Xref: archiver1.google.com comp.lang.ada:38501 Date: 2003-06-03T15:26:13+00:00 List-Id: Russ wrote: > Once again, I will explain why. The first form requires the creation > of a temporary matrix to hold the sum, then a copy from the temporary > back to A. The second form, on the other hand, can do the addition in > place in A on an element by element basis, eliminating the need for > the temporary matrix and the copy operation. Give it a rest. You keep trying to "explain" things like this to a newsgroup where there are several compiler experts who regularly post. Bob, Randy, Tucker and I could probably spend hours discussing where Ada requires that the intermediates be materialized. We have had such discussions, one of the results of those discussions is the Ada 95 Reference Manual. If Ada does require an intermediate value to be materialized, it does so with good reason. Let's take a look at your matrix example. Ada requires that in A := A + B; The value of A be unchanged if Constraint_Error is raised, in other words if there is an overflow when adding one of the elements of A to one of the elements of B. If the type of A and B is modular, then no intermediate is required or used. A better example might be: A := A and B; Where A and B are boolean vectors. This can be done in place. What if Ada did allow: A += B; ? Then the Ada rules would still require that A be unchanged if Constraint_Error was raised, so there would be an intermediate. Of course, a compiler could 'unwind' the partial addition by subtraction to produce the required result. It would be an interesting optimization, but AFAIK, no Ada compiler does it.