Default value for Count in Ada.Containers.Vectors.Append.
Blady-Com opened this issue · comments
Blady-Com commented
Current definitions in Ada.Containers.Vectors:
procedure Prepend (Container : in out Vector; New_Item : Element_Type; Count : Count_Type := 1);
procedure Append (Container : in out Vector; New_Item : Element_Type; Count : Count_Type);
Proposal definition:
Add a default value for Count in Append as for Prepend:
procedure Append (Container : in out Vector; New_Item : Element_Type; Count : Count_Type := 1);
S. Tucker Taft commented
It turns out there is *already* an Append operation where the Count is
implicitly one (paragraph 47.1/5). We had to handle Append and Prepend
differently because Append needed to match the parameter profile expected
for the "Add_Unnamed" part of the Aggregate aspect.
This is all explained in AI12-0400:
http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0400-1.txt?rev=1.5
Take care,
-Tucker Taft
…On Sat, Jan 13, 2024 at 5:34 AM Blady-Com ***@***.***> wrote:
Current definitions in Ada.Containers.Vectors:
procedure Prepend (Container : in out Vector; New_Item : Element_Type; Count : Count_Type := 1);
procedure Append (Container : in out Vector; New_Item : Element_Type; Count : Count_Type);
Proposal definition:
Add a default value for Count in Append as for Prepend:
procedure Append (Container : in out Vector; New_Item : Element_Type;
Count : Count_Type := 1);
—
Reply to this email directly, view it on GitHub
<#76>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANZ4FMORROXDBOC2WWDZFDYOJPK3AVCNFSM6AAAAABBZHHNUOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4DAMRTGIZDCMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
Blady-Com commented
Thanks for your explanation, it's make sens :-).
Note GNAT FSF 13.2 stil defines in aconvec.ads:
procedure Append
(Container : in out Vector;
New_Item : Vector) renames Append_Vector;
-- Retained for now for compatibility; AI12-0400 will remove this.
S. Tucker Taft commented
This was a very tricky fix, because it created some incompatibilities. I think this was a first step. It is probably time now to finish the job and implement what is defined by the Ada 2022 standard.
ARG-Editor commented
This question was adequately answered, so I am closing this Issue.