I think the reasons I chose to remove GetAddress entirely rather than replacing it with multiple methods (like GetPropAddress and GetItemAddress) were:
- Further increasing cost for each type of "container" that can provide a string address. More code and documentation to write, test and maintain. More special cases for users to remember.
- I tentatively plan to experiment with reference-counted strings, which would ideally improve performance and enable StrPtr to be used (relatively) safely with strings from any container.
- There are efficient alternatives. While you may need a pointer to a string, you don't truly need that string to be contained by an array or property.
I think there's a stronger case for using arrays this way than properties or maps, so depending on how v2.1 develops, I might consider restoring GetAddress for arrays.
In retrospect, the capabilities previously present in SetCapacity and GetCapacity may have biased me toward removing GetAddress. Effectively duplicating the functionality of a Buffer into every property, array element and map item is somewhat less appealing than providing a simple method to efficiently utilize strings already stored in an array.