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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Extend slices for n dimensional arrays for Ada 202X Date: Fri, 27 Jan 2017 15:20:04 +0100 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: vZYCW951TbFitc4GdEwQJg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:33199 Date: 2017-01-27T15:20:04+01:00 List-Id: On 27/01/2017 14:53, G.B. wrote: > On 27.01.17 10:34, Dmitry A. Kazakov wrote: >> On 26/01/2017 19:29, Randy Brukardt wrote: >> >>> So I don't see this happening - it doesn't make sense in the context >>> of Ada >>> implementation strategies. >> >> That is why I keep on saying, give users the array interface (and the >> array slice interface) and let users implement their custom arrays. > > Will some Iterator_Interface and generalized > loop iteration not provide for custom arrays? Not even close. Remember the question was about slices. A slice in copying context is an object of same or related type. The latter is when some dimensions get collapsed. E.g. a vector taken from a matrix, it is another type. In the referential context it is even more complicated. A slice is always a type of different representation. As Randy has explained, Ada's built-in array types were designed with referential slices in mind. It is a complex network of related types you cannot emulate with crude hacks like iterator interface. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de