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-16 22:24:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-pas-nf2!newsfeed.earthlink.net!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc04.POSTED!not-for-mail Message-ID: <3EEEA5DC.5090002@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: <3EE7CC70.E1FD3A67@adaworks.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: sccrnsc04 1055827452 24.62.164.137 (Tue, 17 Jun 2003 05:24:12 GMT) NNTP-Posting-Date: Tue, 17 Jun 2003 05:24:12 GMT Organization: AT&T Broadband Date: Tue, 17 Jun 2003 05:24:12 GMT Xref: archiver1.google.com comp.lang.ada:39309 Date: 2003-06-17T05:24:12+00:00 List-Id: Vinzent Hoefler wrote: > Steve wrote: >>but I have had problems >>distinguishing: >> >>shiftTally(shift)(dayOfWeek(month).tallyIndex) >>.sortTally(s).nbRejects := >>shiftTally(shift)(dayOfWeekmonth).tallyIndex).sortTally(s).nbRejects + 1; >> >>from >> >>shiftTally(shift)(dayOfWeek(month).tallyIndex) >>.sortTally(s).nbRejects := >>shiftTally(shift)(dayOfWeekmonth).tallyIndex).sortTally(t).nbRejects + 1; >> >>You might argue that the code was not written well. I don't know about you >>but I don't generally re-write blocks of code I'm maintaining just because >>it doesn't look nice. > > I do. :-) I don't want the one who might come after me, going through > the same shit again. Amen! In my case, that code would never even hit the compiler. Rejects: Integer renames shiftTally(shift)(dayOfWeek(month).tallyIndex).sortTally(s).nbRejects; ... Rejects := Rejects + 1; might. Or it might be: Current: Some_Record_Type renames shiftTally(shift)(dayOfWeek(month).tallyIndex).sortTally(s); ... Current.nbRejects := Current.nbRejects + 1; or it might be that the operation of incrementing the number of rejects gets wrapped in an (inlined) procedure. It all depends on what makes the logic most visible. In this case the question that jumps out once you have done the clean-up should be "Should the increment always be 1?" not "What is this mess?"