Are the Accum_Type & Value_Type (ARM 4.5.10(9/5)) of a reduction attribute reference required to be definite?
ARM 4.5.10(24/5) & (25.5) seem to imply so, which explains why GNAT
doesn't support e.g. String.
"Simon Wright" <simon@pushface.org> wrote in message news:ly5xs4d2ft.fsf@pushface.org...
Are the Accum_Type & Value_Type (ARM 4.5.10(9/5)) of a reduction attribute >> reference required to be definite?
ARM 4.5.10(24/5) & (25.5) seem to imply so, which explains why GNAT
doesn't support e.g. String.
Accum_Subtype (we changed the name since it is a subtype, not a type;
But I don't think String would do anything useful,
since the bounds are determined by the initial value.
BTW, this answer is essentially topic #1 of AI22-0011-1.
"Randy Brukardt" <randy@rrsoftware.com> writes:
Accum_Subtype (we changed the name since it is a subtype, not a type;
Amazing how a person (I) can have used Ada for ~40 years and still be
hard put to it to describe the difference, at least in a case like this
one, where the ARG members clearly see meanings that leave me lukewarm
if not cold. Maybe "the heart of twilight"?
A subtype with no added constraint is similar to a C typedef, but given
subtype Digit is Integer range 0..9;
Digit is distinct from Integer (though they're both the same type).
On Tue, 20 Aug 2024 22:23:27 +0100, Simon Wright wrote:
"Randy Brukardt" <randy@rrsoftware.com> writes:
Accum_Subtype (we changed the name since it is a subtype, not a type;
Amazing how a person (I) can have used Ada for ~40 years and still be
hard put to it to describe the difference, at least in a case like
this one, where the ARG members clearly see meanings that leave me
lukewarm if not cold. Maybe "the heart of twilight"?
I thought the difference was obvious. “subtype” is the C equivalent of “typedef”, just giving a new name to an existing type. So
subtype A is B;
(where A and B are simple identifiers) is valid, whereas
type A is B;
is not: a “type” declaration always creates a new type: you have to
write at least
type A is new B;
and now you have two types with different names that are structurally
the same, but not compatible.
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Tue, 20 Aug 2024 22:23:27 +0100, Simon Wright wrote:
"Randy Brukardt" <randy@rrsoftware.com> writes:
Accum_Subtype (we changed the name since it is a subtype, not a type;
Amazing how a person (I) can have used Ada for ~40 years and still be
hard put to it to describe the difference, at least in a case like
this one, where the ARG members clearly see meanings that leave me
lukewarm if not cold. Maybe "the heart of twilight"?
I thought the difference was obvious. "subtype" is the C equivalent of
"typedef", just giving a new name to an existing type. So
subtype A is B;
(where A and B are simple identifiers) is valid, whereas
type A is B;
is not: a "type" declaration always creates a new type: you have to
write at least
type A is new B;
and now you have two types with different names that are structurally
the same, but not compatible.
Yes, I've understood that for a long time but ... ARM22 4.5.10(8,9)[1]
say
(8) The expected type for a reduction_attribute_reference shall be a
single nonlimited type.
(9) In the remainder of this subclause, we will refer to nonlimited
subtypes Value_Type and Accum_Type of a
reduction_attribute_reference. ...
and in AI 22-0011-1 [2] starting at 22-Oct-2021 5:25 PM,
* SB: raises a series of observations,
* STT: "... You really need to think of Accum_Type as a particular
*subtype*"
* SB: "Ok, I was confused - Accum_Type is a subtype, not a type. So
a lot of my message was noise."
If SB can be confused, so can I!
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 45:07:31 |
Calls: | 8,141 |
Calls today: | 4 |
Files: | 13,085 |
Messages: | 5,858,057 |