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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fe5e779eaf4ecf02 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!d45g2000hsc.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Returning ranges from a function (was: How to loop (elegant) throug a vector ?) Date: Sun, 22 Jun 2008 14:06:36 -0700 (PDT) Organization: http://groups.google.com Message-ID: <37e7c45f-7c3d-464a-8a66-f5911443ec34@d45g2000hsc.googlegroups.com> References: <20080620191237.5971480b@cube.tz.axivion.com> <6ebe0cd8-288e-4997-94d7-61905fd2dfc0@r66g2000hsg.googlegroups.com> <20080622204713.2127db4f@cube.tz.axivion.com> NNTP-Posting-Host: 85.3.107.104 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1214168797 27936 127.0.0.1 (22 Jun 2008 21:06:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 22 Jun 2008 21:06:37 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d45g2000hsc.googlegroups.com; posting-host=85.3.107.104; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:808 Date: 2008-06-22T14:06:36-07:00 List-Id: On 22 Cze, 20:47, Stefan Bellon wrote: > You need to store the two words for First and Last (or First and > Length). And indeed, this is what GNAT does. The 'Size of the array > object returned is two words in size. Now I have noticed the for Empty_Component'Size use 0 part. Sorry for the confusion, but see below for more. :-) > The question is > whether this optimisation (for 'Size use 0) can always be guaranteed. I have a better question: is it *legal*? Consider 3.6/13: "A one-dimensional array has a distinct component for each possible index value." What does it mean - "distinct"? Doesn't it exclude overlays? What about "independent addressability" from 13.3? The text is a bit dense, but I conclude that the 'Size attribute does not have to be strictly obeyed by the implementation. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com