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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4c459ff0adb576bc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-08 09:08:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!newscon02.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr30.news.prodigy.com.POSTED!not-for-mail From: "Pat Rogers" Newsgroups: comp.lang.ada References: <3C5AB0B7.9D75D49A@grammatech.com> <3c639940@pull.gecm.com> <4519e058.0202080714.1bf916bb@posting.google.com> Subject: Re: Refactoring and Ada X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: NNTP-Posting-Host: 208.191.180.40 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr30.news.prodigy.com 1013188047 ST000 208.191.180.40 (Fri, 08 Feb 2002 12:07:27 EST) NNTP-Posting-Date: Fri, 08 Feb 2002 12:07:27 EST Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: FKPO@MONFJVMQVPXJZDBNFXBBZ\LPCXLLBWLOOAFEQR@ETUCCNSKQFCY@TXDX_WHSVB]ZEJLSNY\^J[CUVSA_QLFC^RQHUPH[P[NRWCCMLSNPOD_ESALHUK@TDFUZHBLJ\XGKL^NXA\EVHSP[D_C^B_^JCX^W]CHBAX]POG@SSAZQ\LE[DCNMUPG_VSC@VJM Date: Fri, 08 Feb 2002 17:07:27 GMT Xref: archiver1.google.com comp.lang.ada:19783 Date: 2002-02-08T17:07:27+00:00 List-Id: "martin.m.dowie" wrote in message news:UHS88.8818$as2.1569475@news6-win.server.ntlworld.com... > > > How about removing the 'confirming enumeration rep specs' that > > > are no longer necessary in Ada95? > [snip] > > > > They weren't necessary in Ada 83 either were they? > > My understanding was that there was no requirement for a compiler > to select a contiguous range of values from 0. So while I never actually > came across a compiler that didn't do this, for the sake of portability > they were always added where we cared about the underlying rep. > > Thankfully, we don't have to add this 'noise' anymore :-) but there > must be thousands of lines of code like this around cluttering up code. > From memory Robert Dewar once mentioned that these statements > were actually dangerous (my word not his!) in Ada95. Presumably as a > compiler may mistake them for some sort of 'special case' and produce > some less than optimal code. The issue is indeed performance. (The special case to be recognized by the compiler is that the clause is in fact a confirming rep clause.) The semantics have to be maintained -- eg, array indexing and for-loop iterations -- but the compiler will produce comparably inefficient code unless the special case is recognized. (Most do.) Think about how array element address calculation would work using arbitrarily ascending values for the indexes, and the problem becomes evident. --- Patrick Rogers Consulting and Training in: http://www.classwide.com Real-Time/OO Languages progers@classwide.com Hard Deadline Schedulability Analysis (281)648-3165 Software Fault Tolerance