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,1cb75f0476fe2d1a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newsfeed.gamma.ru!Gamma.RU!news.tele.dk!news.tele.dk!small.news.tele.dk!fi.sn.net!newsfeed2.fi.sn.net!news.song.fi!not-for-mail Date: Sat, 11 Mar 2006 10:38:52 +0200 From: Niklas Holsti Organization: Tidorum Ltd User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Debian/1.7.8-1 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Half Constrained Array Types and Slices References: <1141667416.163432.304280@p10g2000cwp.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <44128c9a$0$25335$39db0f71@news.song.fi> NNTP-Posting-Host: laku61.adsl.netsonic.fi X-Trace: 1142066330 news.song.fi 25335 81.17.205.61:32780 X-Complaints-To: abuse@song.fi Xref: g2news1.google.com comp.lang.ada:3330 Date: 2006-03-11T10:38:52+02:00 List-Id: Jeffrey R. Carter wrote: > Randy Brukardt wrote: > >> ... Empty arrays are never very useful, ... > > FWIW, my opinions are closer to Brukardt's than to Duff's. However, null > arrays are often useful; there are whole classes of recursive algorithms > that look like > > return G (X (X'First) ) & F (X (Index'Succ (X'First) .. X'Last) ); > > with a null array terminating the recursion. I second Jeffrey's opinion. I find that empty arrays are very useful for my applications (program analysis). I could live with a language where A'First and A'Last are available only when A'Length > 0 and might raise Constraint_Error if A'Length = 0. However, "for I in A'Range loop .. end loop" should work even when A'Length = 0 (and do nothing in that case). -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .