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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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!postnews.google.com!f6g2000yqa.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Elias_Salom=E3o_Helou_Neto?= Newsgroups: comp.lang.ada Subject: Re: Efficiency of code generated by Ada compilers Date: Tue, 10 Aug 2010 07:03:13 -0700 (PDT) Organization: http://groups.google.com Message-ID: <76de1822-f4cf-423a-8260-4b1cfac94172@f6g2000yqa.googlegroups.com> References: <1jmwhfp.roo31ybayx2bN%csampson@inetworld.net> <049ff595-3a53-48f3-8001-0d5cf1db0d2a@l6g2000yqb.googlegroups.com> NNTP-Posting-Host: 143.107.183.162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1281448993 22410 127.0.0.1 (10 Aug 2010 14:03:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 10 Aug 2010 14:03:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f6g2000yqa.googlegroups.com; posting-host=143.107.183.162; posting-account=8auP9QoAAACkSx2qxJhP83KA6-tg78E8 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:13063 Date: 2010-08-10T07:03:13-07:00 List-Id: On Aug 10, 9:57=A0am, Yannick Duch=EAne (Hibou57) wrote: > Le Tue, 10 Aug 2010 14:26:25 +0200, Phil Clayton =A0 > a =E9crit: > > > =A0 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, = =A0 > not on type basis. If the array actual range is not the same as the index= =A0 > type range, it fails. So this could not be a type primitive (operator). = =A0 > May be an array attribute ? A'From_Last ? A'Last_Based ? > > "reverse" is already there for loop statements. I feel this makes for sen= s =A0 > for loop, as what is reverse, is not the array index: this is the =A0 > iteration which goes reversed order. > > -- > There is even better than a pragma Assert: a SPARK --# check. > --# check C and WhoKnowWhat and YouKnowWho; > --# assert Ada; > -- =A0i.e. forget about previous premises which leads to conclusion > -- =A0and start with new conclusion as premise. It is a pity that this post became a technical discussion on array indexing. A simple question that could be asked in a single line is: can Ada access arrays without range checking? My algorithm needs not wrapping, neither it needs range checking! Please, try avoiding pointless discussions on wrapped/non-wrapped types. Recall that I do not even know Ada's syntax, let alone its sophisticated type system. Your discussion can only possibly confuse me. Elias.