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: a07f3367d7,caabf5265fad78e5 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: unsigned type Date: Mon, 29 Jun 2009 11:56:44 +0200 Organization: Adalog Message-ID: References: NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1246259539 2536 195.25.228.57 (29 Jun 2009 07:12:19 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Mon, 29 Jun 2009 07:12:19 +0000 (UTC) User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) In-Reply-To: Xref: g2news2.google.com comp.lang.ada:6701 Date: 2009-06-29T11:56:44+02:00 List-Id: anon a �crit : > For Strings: > -- 'A' is a zero length string, A'Last = 0, and > -- put_line ( A ( A'First .. A'Last ) ) ; > -- does not raise an Constraint_Error even though in > -- this case it translate to: > -- put_line ( A ( 0 .. 0 ) ) ; > A : String := "" ; > > Since you can have zero length string , the index is Natual instead of Positive, > because zero is in Natural but is not define in Positive. Even though the > Standard package define String index as a Positive type. (GNAT) > I usually refrain from responding to "anon", but this is so wrong that I have to... (Note: in French, "anon" is a young donkey; maybe that's where he got his name from...) The index of String is Positive, full stop. A'Last is 0 because null ranges are treated specially to avoid spurious Constraint_Error. See 3.5(8) -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr