Dynamic array constants and variable initialization allow for succinct constant record array declaration (
example in wiki). For example, I can do:
procedure Test1;
type
TPerson = record
Name: String;
City: String;
end;
TPeople = array of TPerson;
const
people: TPeople = (
(Name: 'Adam'; City: 'Los Angeles'),
(Name: 'Eve'; City: 'Berlin')
);
begin
{ some code }
end;
However, it doesn't appear that you can initialize a variable that's an array of records with literal syntax. I presume that's because the "literal record syntax" and type inference is limited to the const section:
procedure Test3;
type
TPerson = record
Name: String;
City: String;
end;
TPeople = array of TPerson;
var
people: TPeople;
begin
{ the code below fails, because there's no record literal syntax and type inference }
people := [
(Name: 'Adam'; City: 'Los Angeles'),
(Name: 'Eve'; City: 'Berlin')
];
end;
Is my understanding correct and, if so, has support for this been considered?