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!news3.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, 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: Date: Fri, 10 Mar 2006 04:28:59 GMT NNTP-Posting-Host: 67.150.71.242 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.pas.earthlink.net 1141964939 67.150.71.242 (Thu, 09 Mar 2006 20:28:59 PST) NNTP-Posting-Date: Thu, 09 Mar 2006 20:28:59 PST Xref: g2news1.google.com comp.lang.ada:3320 Date: 2006-03-10T04:28:59+00:00 List-Id: Robert A Duff wrote: > > I don't quite see the point of this. If 'Length = 0, > it seems to me, then the index type must be some sort of integer, > or something like that. It depends on how far afield you want > to go. For example, do you like "array(String range <>) of Integer"? > There's no _range_ there... I think the index type should be discrete. But surely it doesn't need to be an integer: with Ada.Text_IO; procedure Null_Range is type A is (B, C); type D is array (A range <>) of Integer; E : D (C .. B); begin -- Null_Range Ada.Text_IO.Put_Line (Item => A'Image (E'Last) ); end Null_Range; This is valid Ada. With GNAT, it outputs B. However, if D were a string type, "" would not be valid for it. > The idea that 'Range is equivalent to 'First..'Last seems reasonable to > me... I'm not saying it's a good idea. I'm just wondering what the consequences of it are. -- Jeff Carter "Crucifixion's a doddle." Monty Python's Life of Brian 82