Version 1.4 of ai12s/ai12-0403-1.txt
!standard 4.2.1(15/5) 20-10-21 AI12-0403-1/03
!standard 4.2.1(17/5)
!standard 4.2.1(18/5)
!standard 4.2.1(19/5)
!standard 4.3.5(93/5)
!standard H.4.1(2/5)
!class binding interpretation 20-10-15
!status Amendment 1-2012 20-10-21
!status WG9 Approved 22-06-22
!status ARG Approved 14-0-0 20-10-21
!status work item 20-10-15
!status received 20-10-15
!priority Low
!difficulty Easy
!qualifier Omission
!subject Presentation issues from Draft 26 review
!summary
Various wording issues were noted by reviewers of Draft 26.
!question
(1) In 4.3.5(93/5), "Add_Positional" is not defined; it should
be "Append_One", right? (Yes.)
(2) In 4.2.1(17/5), we have
function To_Roman_Number (S : String) return Roman_Number
But this function needs to have a parameter of Wide_Wide_String to
meet the requirements on the profile of a String_Literal function,
right? (Yes.)
(3) In H.4.1(2/5), we have
No_Controlled_Parts
The type of this aspect is Boolean. If True, requires that the
type and any descendants do not have any controlled parts.
The second sentence seems awkward. Should it be reworded? (Yes.)
!recommendation
(1) Fix as suggested.
(2) Add "Wide_Wide_" in a number of places, and reformat as needed.
(3) Reword to use "shall" rather than "require".
!wording
Modify 4.2.1(15/5-20/5):
subtype Roman_Character is {Wide_Wide_}Character
with Static_Predicate =>
Roman_Character in 'I' | 'V' | 'X' | 'L' | 'C' | 'D' | 'M';
Max_Roman_Number : constant := 3_999; --
type Roman_Number is range 1 .. Max_Roman_Number
with String_Literal => To_Roman_Number;
function To_Roman_Number (S : {Wide_Wide_}String) return Roman_Number
with Pre => S'Length > 0 and then
(for all Char of S => Char in Roman_Character);
function To_Roman_Number (S : {Wide_Wide_}String) return Roman_Number is
(declare
R : constant array (Integer range <>) of Roman_Number :=
(for D in S'range => Roman_Digit'Enum_Rep
(Roman_Digit'{Wide_Wide_}Value (''' & S(D) & '''))); --
begin
[for I in R'range =>
(if I < R'Last and then R(I) < R(I + 1) then -1 else 1) * R(I)]
'Reduce("+", 0)
);
X : Roman_Number := "III" * "IV" * "XII"; --
Modify 4.3.5(93/5):
-- Is equivalent to:
V := Empty_Vector (<estimate of size of M>); for Elem of M loop
[Add_Positional]{Append_One} (V, Elem); end loop;
Modify H.4.1(2/5):
No_Controlled_Parts
The type of this aspect is Boolean. If True, [requires that ]the type and
any descendants {shall}[do] not have any controlled parts. If specified,
the value of the expression shall be static. If not specified, the value
of this aspect is False.
!discussion
(See !recommendation.)
!corrigendum 4.2.1(0)
@insc
See the conflict file for the changes.
!corrigendum 4.3.5(0)
Insert new clause:
See the conflict file for the changes.
!corrigendum H.4.1(0)
Insert new clause:
See the conflict file for the changes.
!ASIS
No ASIS effect.
!ACATS test
No ACATS tests should be needed, none of these changes change any semantics.
!appendix
!topic Wrong profile in 4.2.1 Examples
!reference Ada 202x RM4.2.1(18/5,19/5)
!from Max Reznik 20-09-14
!keywords User-Defined String Literal Wide_Wide_String
!discussion
In ARM 202x Draft 26 "4.2.1 User-Defined Literals" there is an example:
function To_Roman_Number (S : String) return Roman_Number
But its profile is incorrect, because, according to the rules above,
the parameter should have Wide_Wide_String type.
****************************************************************
!topic Wrong profile in 4.2.1 Examples
!reference Ada 202x RM4.2.1(18/5,19/5)
!from Max Reznik 20-09-14
!keywords User-Defined String Literal Wide_Wide_String !discussion
In ARM 202x Draft 26 "4.2.1 User-Defined Literals" there is an example:
function To_Roman_Number (S : String) return Roman_Number
But its profile is incorrect, because, according to the rules above, the
parameter should have Wide_Wide_String type.
****************************************************************
From: Christoph Grein
Sent: Wednesday, September 23, 2020 7:35 AM
There is more wrong:
In (19/5) Reduce("+", 0), zero does not belong to the subtype Roman_Number,
so it's illegal.
****************************************************************
From: Christoph Grein
Sent: Wednesday, September 23, 2020 7:59 AM
Oh, and also negative numbers are not in range, so also this is illegal:
(if I < R'Last and then R(I) < R(I + 1) then -1 else 1) * R(I)]
****************************************************************
From: Christoph Grein
Sent: Saturday, October 3, 2020 5:24 AM
Hm, I withdraw my claims about the initial value 0 and factor -1 being
illegal. value_type and accum_type are Roman_Number'Base, a subtype of the
type of Roman_Number.
****************************************************************
From: Tucker Taft
Sent: Monday, October 5, 2020 9:21 AM
In 4.3.5(93/5), the example should be fixed as follows:
-- Is equivalent to:
V := Empty_Vector (<estimate of size of M>); for Elem of M loop
[Add_Positional]{Append_One} (V, Elem); end loop;
****************************************************************
From: Claire Dross
Sent: Friday, September 18, 2020 9:54 AM
[Part of Claire's RM review - Editor.]
Annex H
2/5 No_Controlled_Parts
The type of this aspect is Boolean. If True, requires that the
type and any descendants do not have any controlled parts.
>> I am not a native speaker, but the sentence seems awkward to me. Maybe
>> someone could double check?
****************************************************************
From: Tucker Taft
Sent: Friday, September 18, 2020 10:39 AM
Agreed. The word "do" could be dropped -- "If True, requires that the type
and any descendants not have any controlled parts."
****************************************************************
From: John Barnes
Sent: Friday, September 18, 2020 5:03 PM
This is awkward. I would retain the do. The English language is, I believe ,
somewhat flawed in this area.
****************************************************************
From: Richard Wai
Sent: Friday, September 18, 2020 5:14 PM
I agree! I felt removing the 'do' sounded somewhat archaic. I wasn't going to
chime in, but your distinguished opinion lends credibility!
****************************************************************
From: Bob Duff
Sent: Friday, September 18, 2020 6:09 PM
> This is awkward. I would retain the do. The English language is, I
> believe , somewhat flawed in this area.
Which English language? ;-)
To me, it reads OK with or without the "do". I think slightly better with.
****************************************************************
From: John Barnes
Sent: Saturday, September 19, 2020 3:58 AM
Oh dear, Bob said
-----Original Message-----
"John Barnes" wrote:
> This is awkward. I would retain the do. The English language is, I
> believe , somewhat flawed in this area.
Which English language? ;-)
To me, it reads OK with or without the "do". I think slightly better with.
=======
And Richard agreed as well.
======
To me it reads better with do.
I had a problem sleeping last night thinking about do and not.
In some situations we can just insert not to produce negation but in some
cases we need an auxiliary verb such as do
if the verbal form is normal present indicative then we need do.
Thus
I kill the dragon.
I do not kill the dragon.
We cannot say (in Modern English)
I kill not the dragon. or I not kill the dragon
We have to have do as an auxiliary verb.
However, if we use a continuous form
I am killing the dragon
then we can say
I am not killing the dragon.
I have consulted all the books I have which is many. None address this
topic.
Bobby (my wife) used to work in the linguistics department of Reading
University. She could try contacting some venerable academics such as
David Crystal.
Her first reaction to this problem was that
"small children and non-native English speakers often omit do"
One can waste a lot of one's life fretting over this sort of thing.
In the case in hand it is made more complex by being an auxiliary clause
anyway. Maybe it should be in the subjunctive. One could try translating
it into Latin and then analysing the situation.
I wonder what a German speaker would say. Erhard??
Do have a nice day.
****************************************************************
From: Tucker Taft
Sent: Saturday, September 19, 2020 7:55 AM
Decency requires that Americans not use "do" in such contexts... ;-)
****************************************************************
From: Jeff Cousins
Sent: Saturday, September 19, 2020 5:07 AM
> To me, it reads OK with or without the "do". I think slightly better with.
Ditto
****************************************************************
From: Erhard Ploedereder
Sent: Saturday, September 19, 2020 8:59 PM
> I wonder what a German speaker would say. Erhard??
I don't think we have a comparable situation in German wrt an auxillary word
in these contexts.
As to my foreign D-English, I normally use the do and omit it only in rare
cases, especially when the remainder is short or if it happens to save a
crucial line in print ;-).
And I use it for emphasis of course, as you do.
The "do" also avoids the burning question whether:
"Requires that the type have"
or
"Requires that the type has".
I do not like the former, probably because, for this situation, we do have
an analogy in German:
"Erfordert dass der Typ X habe" (a subjunctive, since it might not) vs.
"Erfordert dass der Typ X hat" (present, more assertive)
The first form is theoretically more correct, but any text that contains it,
is likely older than me. Nobody is using a subjunctive in this context any
more.
Incidently, for the example that started this:
1. Hate sentences that are not.
2. Do not like to be thrown verbal bones to catch.
3. (Know that this is often done in the RM in
similar contexts.)
As in "Requires that a sentence has a subject."
****************************************************************
From: John Barnes
Sent: Monday, September 21, 2020 5:06 AM
The subjunctive is fading in Br Engilsh too. One use is in a phrase such as
"If I were you I would have a large gin." rather than "If I was you...
On the other hand it is very rare in the present tense. Thus
"If I be good" sounds archaic, I am sure I would say "If I am good..."
I think we can agree that languages both human and computer are tricky topics!
****************************************************************
From: Randy Brukardt
Sent: Wednesday, September 23, 2020 12:09 AM
> Annex H
> 2/5 No_Controlled_Parts
> The type of this aspect is Boolean. If True, requires that
> the type and any descendants do not have any controlled
> parts.
>
> >> I am not a native speaker, but the sentence seems awkward to me.
> >> Maybe someone could double check?
Followed by a lot of non-advice which boils down to no credible direction for
the editor at all. Thanks a lot guys!
Anyway, this is like a restriction that applies to a single set of
descendants, and as such is going to be awkward since it is combining a
negative with "True".
Probably the best thing to do with this one is to rearrange and make it clear
this is a Legality Rule:
No_Controlled_Parts
The type of this aspect is Boolean. If True, the
type and any descendants shall not have any controlled parts.
And I got rid of the "do", making the whole discussion moot. I hope. ;-)
****************************************************************
Questions? Ask the ACAA Technical Agent