3 ms·
What a lot of people don't understand is the reason that Ada has so many string-types, and the answer is pretty simple: usage. Fixed: The simple string-as-an-a
by OneWingedShark 6y ago
What a lot of people don't understand is the reason that Ada has so many string-types, and the answer is pretty simple: usage.
Fixed: The simple string-as-an-array approach.
Bounded: The maximum, but variable-size approach; analogous to many database string-field data-definitions.
Unbounded: The variable-at-runtime approach.
You can generally use the Fixed form for your operations, thanks to the String-array being unbounded, and having functions returning your perfectly-sized results.
My biggest issue with the Strings packages are the [[Wide_]Wide_]String hierarchy: I would have much rather had this be a set of instantiated generics with the appropriate parameters (eg passing in a CHARACTER type and UPPERCASE/LOWERCASE functions, etc)... but doing that would have required redesigning the STRINGS package back at the Ada95 era.