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!k37g2000hsf.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: Mon, 23 Jun 2008 05:06:26 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5f3204b8-5f93-4a65-a7ff-86abb3a839e9@k37g2000hsf.googlegroups.com> References: <20080620191237.5971480b@cube.tz.axivion.com> <6ebe0cd8-288e-4997-94d7-61905fd2dfc0@r66g2000hsg.googlegroups.com> <20080622204713.2127db4f@cube.tz.axivion.com> <37e7c45f-7c3d-464a-8a66-f5911443ec34@d45g2000hsc.googlegroups.com> <20080623114742.748d3869@cube.tz.axivion.com> NNTP-Posting-Host: 128.141.45.223 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1214222787 16746 127.0.0.1 (23 Jun 2008 12:06:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 23 Jun 2008 12:06:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k37g2000hsf.googlegroups.com; posting-host=128.141.45.223; 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:815 Date: 2008-06-23T05:06:26-07:00 List-Id: On 23 Cze, 11:47, Stefan Bellon wrote: > > What about "independent addressability" from 13.3? > I don't think this applies here as the array components are not aliased With my version of GNAT everything is stored at the same location when "aliased" is added to components of the array. I can see it by having *equal* access variables created from different array indices: with Ada.Text_IO; procedure A is type Empty_Record is null record; for Empty_Record'Size use 0; A : array (Integer range <>) of aliased Empty_Record := (1 .. 100 => <>); type Empty_Ptr is access all Empty_Record; P1 : Empty_Ptr := A (1)'Access; P2 : Empty_Ptr := A (2)'Access; begin if P1 = P2 then Ada.Text_IO.Put_Line ("Equal access values."); else Ada.Text_IO.Put_Line ("Distinct access values."); end if; end; Is it bug or feature? > But in any case my "range objects" do not rely on the compiler not > allocating memory. Right, but they just expose an interesting compiler behavior. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com