comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R.Carter" <spam.jrcarter.not@spam.acm.org.not>
Subject: Re: New aggregates with Ada 2022.
Date: Wed, 29 Jun 2022 14:53:33 +0200	[thread overview]
Message-ID: <t9hi0d$1ebn4$1@dont-email.me> (raw)
In-Reply-To: <ji2q1nFu6qeU1@mid.individual.net>

On 2022-06-29 13:06, Niklas Holsti wrote:
> On 2022-06-29 11:30, Jeffrey R.Carter wrote:
>>
>> * Maps are usually constrained. It does not make sense to concatenate, sort, 
>> slice, or slide a map.
> 
> In mathematics, maps (functions) are often sliced, in other words restricted to 
> a subset of their full domain. They are also often concatenated, in the sense of 
> combining functions defined on separate domain sets into a combined function 
> defined on the union of those separate domain sets. Those operations would be 
> useful in programs too.
> 
> The essential aspect of maps and map operations is that there is no "sliding" 
> that changes the relationship of domain values (keys) with range values.
> 
> That said, it very often makes sense to provide sorted access to the elements of 
> a map, sorted by some criterion, while maintaining the relationship of keys and 
> their mapped values. That might be seen as sorting the map into a sequence (as 
> described below).

Perhaps I could have been clearer. I mean that it doesn't make sense to 
concatenate, sort, slice, or slide an array used as a map. For example, if we 
represent a map Character => Natural as

type Char_Count_Map is array (Character) of Natural;
Map : Char_Count_Map;

and want a map with the domain restricted to the ASCII letters, both capital and 
small,

Map ('A' .. 'Z') & Map ('a' ..'z')

doesn't do what we want.

You are talking about the abstraction of a map in general, and the operations 
you describe are different from the array operations I was talking about.

-- 
Jeff Carter
"[T]he language [Ada] incorporates many excellent structural
features which have proved their value in many precursor
languages ..."
C. A. R. Hoare
180

  reply	other threads:[~2022-06-29 12:53 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 [this message]
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
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