comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Extend slices for n dimensional arrays for Ada 202X
Date: Fri, 27 Jan 2017 17:37:33 -0600
Date: 2017-01-27T17:37:33-06:00	[thread overview]
Message-ID: <o6gljt$3pv$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: o6fja1$vq8$1@dont-email.me

"G.B." <bauhaus@notmyhomepage.invalid> 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.


  parent reply	other threads:[~2017-01-27 23:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26 13:29 REQ: Extend slices for n dimensional arrays for Ada 202X Lucretia
2017-01-26 14:01 ` Lucretia
2017-01-26 14:03   ` Lucretia
2017-01-26 14:52   ` Dmitry A. Kazakov
2017-01-27  9:19     ` Alejandro R. Mosteo
2017-01-27 14:04     ` Lucretia
2017-01-26 18:29 ` Randy Brukardt
2017-01-27  1:54   ` Robert Eachus
2017-01-27  5:39     ` Robert Eachus
2017-01-27 14:06     ` Lucretia
2017-01-27 23:30     ` Randy Brukardt
2017-01-28  0:58       ` Robert Eachus
2017-01-27  9:34   ` Dmitry A. Kazakov
2017-01-27 13:53     ` G.B.
2017-01-27 14:20       ` Dmitry A. Kazakov
2017-01-27 23:37       ` Randy Brukardt [this message]
2017-01-28  9:08         ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox