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-Thread: 103376,2a34b7ad6c6a0774 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail From: =?iso-8859-15?Q?Yannick_Duch=EAne_=28Hibou57=29?= Newsgroups: comp.lang.ada Subject: Re: Efficiency of code generated by Ada compilers Date: Tue, 10 Aug 2010 14:57:32 +0200 Organization: Ada At Home Message-ID: References: <1jmwhfp.roo31ybayx2bN%csampson@inetworld.net> <049ff595-3a53-48f3-8001-0d5cf1db0d2a@l6g2000yqb.googlegroups.com> NNTP-Posting-Host: anOtUalzMUZHasssFqT+2w.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.60 (Win32) Xref: g2news1.google.com comp.lang.ada:13057 Date: 2010-08-10T14:57:32+02:00 List-Id: Le Tue, 10 Aug 2010 14:26:25 +0200, Phil Clayton = a =E9crit: > A(A'Length - I - 1) > > (not valid Ada, of course.) A(A'Last - (I - A'First)) > Perhaps "reverse" would be a better name for the operator "not" when > the modulus is not a power of two? Or "wrapped" ? But this would only make sens on an array instance basis,= = not on type basis. If the array actual range is not the same as the inde= x = type range, it fails. So this could not be a type primitive (operator). = = May be an array attribute ? A'From_Last ? A'Last_Based ? "reverse" is already there for loop statements. I feel this makes for se= ns = for loop, as what is reverse, is not the array index: this is the = iteration which goes reversed order. -- = There is even better than a pragma Assert: a SPARK --# check. --# check C and WhoKnowWhat and YouKnowWho; --# assert Ada; -- i.e. forget about previous premises which leads to conclusion -- and start with new conclusion as premise.