I just read Ada Programming, but I'm a little confused about how to use '(single quote) in Ada.
I understand what is 'used for reference attribute. AAA'Image (..), BBB'Value (..)
However, given this piece of code:
type Plain_Vector (Capacity : Capacity_Subtype) is record
Elements : Elements_Array (1 .. Capacity);
Last : Extended_Index := No_Index;
Busy : Natural := 0;
Lock : Natural := 0;
end record;
------------------------------------------------------------------
new Plain_Vector'(2, (Left, Right), Last => Last, others => <>)
Q1: How do the arguments of the “new” operator correspond to type parameters and record fields?
I can GUESS "2" matched "Capacity",
"(Left, Right)" matched "Elements",
"Last => Last" matched "Last"
"Others => <>" matched "Busy" and "Lock" to let them use default value.
But this is only GUESSING, is there an official grammar explanation on this?
Q2: What does '? (in the "new" statement)
Is this an attribute or does it have any other meanings?
" " Ada?
, .
. .