So this is probably the thing that most bugs me when doing a Pascal project, that I don't have any easy to use string dictionaries at hand. I'd argue that the probably most useful datastructure aside from the base types and arrays are probably a simple dictionary for String based Key-Value pairs.
There are some types available, e.g. TDictionary and THashMap from Generics.Collections or TFPGMap from fgl, but they don't really work (at least out of the box) with string keys, as they use the pointer to that string as key rather than the string itself.
There are alternatives, like TStringList, and there are some oldschool Hashmap types that map to raw pointers, but they are very cumbersome and inconvinient to use. And that is a staple and a very essential datatype in pretty much all other languages.
So my idea was, that this could be added on the language level as simpe associative array:
var
map: Array[String] of Integer;
begin
map['foo'] := 42;
if 'foo' in map then
WriteLn(map['foo']);
end;
On a syntactic level this would not be that dissimilar from the existing associative arrays for enums:
type
TTest = (test1, test2);
var
map: Array[TTest] of Integer;
Of course the underlying technology must be differently, as the above will just create an Array with test1..test2, but from a high level view it would not be that different, and be very useful.
There is already a lot of compiler magic and special treatment for strings, e.g. they work in case-of, and overall are a pretty magical datatype, so adding some more magic would not be that disruptive, and in return I can't stress enough how useful this would be (especially if it's lazy copy and reference counted like normal dynamic arrays).