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-Thread: 103376,f93747e1bf7a65bb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.135.231 with SMTP id pv7mr15398905pbb.8.1330435708568; Tue, 28 Feb 2012 05:28:28 -0800 (PST) Path: h9ni19055pbe.0!nntp.google.com!news2.google.com!postnews.google.com!eb6g2000vbb.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: Banging the Ada Drum. Date: Tue, 28 Feb 2012 05:26:44 -0800 (PST) Organization: http://groups.google.com Message-ID: <96f679f5-1cd1-4edc-904c-6e8e0f727ed9@eb6g2000vbb.googlegroups.com> References: <967bd137-f854-47e1-9d31-e9236c1c0d00@z31g2000vbt.googlegroups.com> <83178b55-da15-421a-9747-451db4e495c0@cj6g2000vbb.googlegroups.com> <02446aed-cb74-42f2-9f0f-9ed6b9535e8b@v2g2000vbx.googlegroups.com> NNTP-Posting-Host: 20.133.0.8 Mime-Version: 1.0 X-Trace: posting.google.com 1330435708 25800 127.0.0.1 (28 Feb 2012 13:28:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 28 Feb 2012 13:28:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: eb6g2000vbb.googlegroups.com; posting-host=20.133.0.8; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALERCFNK X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20100101 Firefox/11.0,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-02-28T05:26:44-08:00 List-Id: On Feb 28, 11:49=A0am, adacrypt wrote: > On Feb 28, 10:49=A0am, Martin wrote: > > > > > > > > > > > On Feb 28, 9:39=A0am, adacrypt wrote: > > [snip] > > > =A0 FOR I in 30 ..1030 LOOP > > =A0 =A0 A(I) :=3D Alices_Digital_Signature.GetUnits(Numin =3D> I); > > =A0 =A0 B(I) :=3D Alices_Digital_Signature.GetUnits(Numin =3D> I); > > =A0 END LOOP; > > > Don't explicitly re-use the array limits in loops, prefer: > > > =A0 =A0for I in A'Range loop > > =A0 =A0 =A0 A (I) :=3D ... > > > Now the compiler may not inject checks on "A (I)" as it knows that the > > range of "I" is derived directly from "A". > > > Why have different types for A and B - they are both just arrays of > > Integer with the same index. If you really want to make them > > different, you could do: > > > =A0 =A0type Index is range 30 .. 1_030; > > =A0 =A0type A_Array_Type is array (Index) of Integer; > > =A0 =A0type B_Array_Type is new A_Array_Type; > > > =A0 =A0A : A_Array_Type; > > =A0 =A0B : B_Array_Type; > > > BTW, are you assuming Integer is 32-bits? Because it doesn't have to > > be...it could be as small as 16 bits or larger than 32. > > > -- Martin > > Martin, > > May I explain that I am =A0a retired Ship's Engineer in my late > seventies - I am taking your points on board very self-consciously and > normally would leap at the improvements you suggest - in fact could I > ask you to continue and I will build these improvements into my > existing work. > > If I was younger I would have a far more ambitious outlook in > improving my Ada - please keep on pointing out improvements that I can > make. > > Also, > > Would you please consider rewriting this entire software in your > version of it and I will post that up on my website under yor name or > even your own website with a link from mine. > > Thanks again. > > - adacrypt Hi adacrypt, I appreciate every review comment can feel like a personal dig - I really, really don't mean it to be. You're assertion that you wanted clear code just seemed at odds with what appeared in front of me when I unzipped you file! I totally agree that simple, clear code is goal worth striving for but my first comments were simply on the substance of "style" and not "coding elegance". Without the former, it is extremely hard to achieve the latter. I'll take another look when I get home and see what happens by simply getting GNAT/GPS to reformat the code - I imagine the entire structure will much more readily and thus any potential bottlenecks will appear more swiftly. HTH -- Martin