comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: New aggregates with Ada 2022.
Date: Tue, 28 Jun 2022 23:07:01 -0500	[thread overview]
Message-ID: <t9gj5a$1bcln$1@dont-email.me> (raw)
In-Reply-To: t9ebvc$1amt$1@gioia.aioe.org

What you say here is precisely how they should work. But you would make the 
cost of supporting that necessary on every array object, because one could 
not know when an array is passed as a parameter what sort of representation 
it has. So one has to use dispatching helper operations to implement all 
assignments. And that's way more expensive than traditional array 
implementation.

If you didn't have slices that could be passed as array parameters, then 
that problem does not exist. And I don't think slices are sufficiently 
worthwhile to force expensive, unoptimizable code.

                                 Randy.

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:t9ebvc$1amt$1@gioia.aioe.org...
> On 2022-06-27 23:37, Randy Brukardt wrote:
>
>> The distributed overhead that they cause is
>> immense (for instance, you can't have a discontigious array 
>> represesentation
>> with slices, unless you are willing to pay a substantial cost for *every*
>> array parameter). They're the anti-abstraction feature.
>
> There is nothing wrong with having non-contiguous slices of non-contiguous 
> arrays! Contiguity of index does not automatically imply contiguity of 
> element allocation, unless specifically required by the [sub]type 
> constraint.
>
> 1D array abstraction is a mapping index -> element where
>
> 1. Index has an order. Index has operations 'Succ and 'Pred;
>
> 2. The mapping is convex. If there are elements for two indices, then 
> there are elements for all indices between them.
>
> Contiguity is a representation constraint.
>
> One should be able to have an array equivalent of unbounded string with 
> unbounded slices both allocated non-contiguously. The slices you could 
> shrink or expand:
>
>    Text (45..80) := "";  -- Cut a piece off
>
> At the same time one should have a contiguous subtype of the same 
> unbounded string for interfacing purposes, dealt by copy-out copy-in.
>
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de 


  reply	other threads:[~2022-06-29  4:07 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-19  7:59 New aggregates with Ada 2022 Blady
2022-06-19 14:15 ` Simon Wright
2022-06-20 19:36   ` Blady
2022-06-20 22:01     ` Simon Wright
2022-06-20 21:47 ` Randy Brukardt
2022-06-20 22:18   ` Dmitry A. Kazakov
2022-06-21 23:28     ` Randy Brukardt
2022-06-22  9:04       ` Dmitry A. Kazakov
2022-06-23  1:06         ` Randy Brukardt
2022-06-23  9:32           ` Dmitry A. Kazakov
2022-06-23 10:53             ` G.B.
2022-06-24  1:21               ` Randy Brukardt
2022-06-24  1:24             ` Randy Brukardt
2022-06-24  6:50               ` Dmitry A. Kazakov
2022-06-25  3:13                 ` Randy Brukardt
2022-06-25  8:50                   ` Dmitry A. Kazakov
2022-06-27 21:37                     ` Randy Brukardt
2022-06-28  5:36                       ` Niklas Holsti
2022-06-29  4:01                         ` Randy Brukardt
2022-06-29  8:30                           ` Jeffrey R.Carter
2022-06-29  9:04                             ` Dmitry A. Kazakov
2022-06-30  5:03                               ` Randy Brukardt
2022-06-30  8:44                                 ` Dmitry A. Kazakov
2022-06-29 11:06                             ` Niklas Holsti
2022-06-29 12:53                               ` Jeffrey R.Carter
2022-06-30  5:07                                 ` Randy Brukardt
2022-06-30  5:14                               ` Randy Brukardt
2022-06-30  8:31                                 ` Marius Amado-Alves
2022-07-01  5:20                                   ` Randy Brukardt
2022-06-30 10:30                                 ` Jeffrey R.Carter
2022-06-30 15:48                                   ` Marius Amado-Alves
2022-06-30 16:39                                     ` Jeffrey R.Carter
2022-07-01  0:07                                       ` Marius Amado-Alves
2022-06-28  7:52                       ` Dmitry A. Kazakov
2022-06-29  4:07                         ` Randy Brukardt [this message]
2022-06-29  7:24                           ` Dmitry A. Kazakov
2022-06-30  5:00                             ` Randy Brukardt
2022-06-21 23:39     ` Randy Brukardt
2022-06-22  8:26       ` Dmitry A. Kazakov
2022-06-23  1:10         ` Randy Brukardt
2022-06-23  9:32           ` Dmitry A. Kazakov
2022-06-20 22:10 ` Jesper Quorning
2022-06-20 22:59   ` Jesper Quorning
2022-06-21 23:20     ` Randy Brukardt
replies disabled

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