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!nntp-feed.chiark.greenend.org.uk!ewrotcd!reality.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Extend slices for n dimensional arrays for Ada 202X Date: Fri, 27 Jan 2017 17:37:33 -0600 Organization: JSA Research & Innovation Message-ID: References: NNTP-Posting-Host: rrsoftware.com X-Trace: franka.jacob-sparre.dk 1485560253 3903 24.196.82.226 (27 Jan 2017 23:37:33 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 27 Jan 2017 23:37:33 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:33204 Date: 2017-01-27T17:37:33-06:00 List-Id: "G.B." wrote in message news:o6fja1$vq8$1@dont-email.me... > 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? ...and generalized indexing. But those features don't have an provision for slices, and I don't see any way that they could be usefully extended to give slices. I tried a few years ago to come up with a Root_String_Class, which mostly would work well, but it gets ugly when dealing with slices and string literals. You can make something that works like a slice, but assigning into them or passing them as parameters would always require copies. Whether that's acceptable would depend on the application. (It doesn't seem to be a general solution.) I'm unconvinced that Dmitry's array interfaces would have been any better: general slices really don't fit very well into any type model since they're a different shape (in general) than the originating array type. Randy.