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,587e0e0a16d65b10 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!news.motzarella.org!motzarella.org!octagram.motzarella.org!not-for-mail From: Ivan Levashew Newsgroups: comp.lang.ada Subject: Re: Invade wikipedia! Date: Sat, 28 Feb 2009 11:26:32 +0600 Organization: A noiseless patient Spider Message-ID: References: <49a6d506$0$32680$9b4e6d93@newsspool2.arcor-online.net> <4a18f335-30f6-4216-8376-0310eb560445@p11g2000yqe.googlegroups.com> <49a7ced2$0$31342$9b4e6d93@newsspool4.arcor-online.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.eternal-september.org U2FsdGVkX18rb7uESw3uq2l4RFdf/2CydCLTluVEmWkdhmKTx343p2GPL0CXuvoJc4nDo4EwAnMp9AiPRmCnE8UhmSSsS6Gm+CnHcuraqiKM0Ts6zOeMFTr3ZL1O8MjONUtyD90kEa21rKISVckNHA== X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers NNTP-Posting-Date: Sat, 28 Feb 2009 05:25:48 +0000 (UTC) In-Reply-To: X-Auth-Sender: U2FsdGVkX19dR7+0rTBgI0Gyaot+Iq71FJFx1boTPt0x8zV+PE4ZTQ== X-Image-URL: http://img220.echo.cx/img220/9664/111408397042725603791c71pb.gif Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEUAAAOZlpMaJz3/9fYs //8FP1E2M3Qbef+MAAACEklEQVQ4jZ2TTW7bMBCFJwO465B2uqZfS+4NnyBA7LXMerSPEPL+R+gb KqmTIAWKDiCCmo9v/kSJqGaVJCp/TLk3kbypSPmdX2QD2YikTUrAe6CqiWuCL/LR3Cfu/AJgbP4K Phtjfz77vwAfOv4XkNPXVSkqwZvmfTZMAriHMOGG1EOt7xw1Rli8hTIkV4DDTIFn6qqYZJ5JFLhT yIVnHAoIrlYTNGKf7yVMUS4yvYITdC8EMaZwHyX4t4ERnCv2uN+HGMFH4x2bHuDEahD1IUR18LAn mC3Jjork3Wny28Gp+h1pMhR08VV9s55hc/J08qrg90RHP15uXag4c1pYMFvVbHmBB3bFtVGBpVwe z+Hno7UyABU8yYEt1l5q+P54Mj8sM5dsVdRqu4RDCLvWGn2lj8pMJdC2BMdtCFG0L8rptiz6Y3s8 Hh1wjehXby133vRneo5hBSgvu+rfozdodnDYui6g7645m1jpVXELFUtnz6yo9MUKfo1YhzXF6WSc bu09Ax7rcGSsgNKezKggaDNGLH8icz80EsmlcwxOPMcBBJZd0VnWzOnSGbYUMEXNnqO00gvB4p1T gG7TUMydxjljz9xxAAyFzUvpfiEZLHD91iwNhVmvfXybYaksDioVlDh4JdqbwVYFyQ2Unq8EeQDr GDfcrS/ZUF8VJAtWUW8pPyFXr8oDMun4r0pHgiVMafoNgUqRDtakwdAAAAAASUVORK5CYII= X-Face: *tpB#/X3&Zh\?<4l;hAgY:m6lt6L]v#Udy\Xwy{@<'qP=9clA}kEbbSV1]B0a^O{|ibsNV~|zu.Da}V4*se@ns!8*Bt$9l-]nbD}o*7ml9J2)u:"!6P%_-`y9,'.L.Psp),njUf!=F5;kx%~\,'D$%{" Cancel-Lock: sha1:ed8mChE6tFlDU6ZlrFrXob9shA8= User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; ru; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 ThunderBrowse/3.2.2.1 Mnenhy/0.7.6.666 Xref: g2news2.google.com comp.lang.ada:4810 Date: 2009-02-28T11:26:32+06:00 List-Id: Dmitry A. Kazakov wrote: > > You do not need T'Base in this case because it is cleaner and more > efficient to rewrite it in a form that would always keep all indices within > the array range: > > procedure Insertion_Sort (A: in out Mug_List) is > begin > for I in A'First + 1..A'Last loop > declare > Value : constant Mug := A (I); > J : Mug_Number := I - 1; > begin > while A (J) > Value loop > A (J + 1) := A (J); > exit when J = A'First; > J := J - 1; > end loop; > A (J) := Value; > end; > end loop; > end Insertion_Sort; > > Of course an Ada purist would also replace integer index arithmetic with > I'Succ and I'Pred. But that would likely be too much for wiki brains... > (:-)) > By the way, I use to indent 'exit when' the same as surrounding loop-end-loop e. g. loop Read_Next_Value; exit when Is_Done; Process_Value; end loop; -- If you want to get to the top, you have to start at the bottom