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!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How to access an array using two different indexing schemes Date: Thu, 30 Nov 2017 16:10:21 -0600 Organization: JSA Research & Innovation Message-ID: References: <0b6bd27e-e9ec-4854-bbb1-85e1d9ac92e1@googlegroups.com> <227d5a7f-6d5b-4b76-ac31-7d15bb6dc284@googlegroups.com> <16c980c2-1fa6-4084-97ea-b576c75b99c3@googlegroups.com> <3ca6a682-9af1-40e3-a4ac-db739b38e4d7@googlegroups.com> <8a31c728-0261-4f41-b82e-e7128369ebc1@googlegroups.com> <6c5efd03-6dfe-4024-9c28-b4460006ed39@googlegroups.com> Injection-Date: Thu, 30 Nov 2017 22:10:22 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="9783"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:49284 Date: 2017-11-30T16:10:21-06:00 List-Id: "Shark8" wrote in message news:ed357f21-d318-4768-a756-b86e9532a1ae@googlegroups.com... >On Thursday, November 30, 2017 at 12:31:53 PM UTC-7, G. B. wrote: >> AdaMagica wrote: >> > Am Donnerstag, 30. November 2017 15:47:40 UTC+1 schrieb Niklas Holsti: >> >> Perhaps the next Ada revision could extend 4.6(5/2) to include a type >> >> conversion in a renaming, as a view conversion? >> > >> > I sent this request to Ada Comment. >> > >> >> Isn't a type conversion potentially copying? > >Perhaps, but a renaming [of extant data] shouldn't be... Especially in this >particular case since we have bounds-sliding anyways. This particular case is safe, but it is not safe if the type conversion does any sort of representation change. (In that case, the representation change would be hidden from the uses, which Ada has never wanted to do.) Not sure how to reconcile that. In any case, parameter passing does work for the OPs problem (as I showed), so there is a solution, even if it is a bit clunky. Randy. What is wanted here is a View Conversion, not really a Type Conversion.