Feedback is welcome on actual use cases.
Le mardi 1 mars 2022 à 21:47:51 UTC+1, Blady a écrit :bytes and characters.
Feedback is welcome on actual use cases.
Hello Pascal,
Thank you very much for this great improvement over Unbounded Strings !
Sure a short string optimization, such a the one implemented in GNATColl.XStrings, would be appreciated.
As a personnal taste, I would appreciate to have a UXCharacter type that is a Wide_Wide_Character, and an ASCII_Character, or a Char that is a subtype of it.
I think that the ASCII_String could be a derived type of UXString since it is a proper subtype, that specializes the UXString to only ASCII Characters. Some primitive operations can then be overriden to take advantage of the direct mapping between
Thus, for UXStrings, I choose Unicode_Character type as "generic"
character (which renames Wide_Wide_Character), see for instance: https://github.com/Blady-Com/UXStrings/blob/master/src/uxstrings1.ads#L58
May you be more specific?
What advantages for the user would bring a UXCharacter type?
Then I realize - and hence I contredict my own previous post - that
the important concept for the user is the Grapheme cluster . So in
fact a UXCharacter should simply be a subtype of UXString storing one Grapheme Cluster.
Personally I like the semantic - I know this[1] is a macOS problem, but
it comes to something when you get a warning like
páck3.ads:1:10: warning: file name does not match unit name,
should be "páck3.ads"
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81114#c1
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 349 |
Nodes: | 16 (3 / 13) |
Uptime: | 139:18:26 |
Calls: | 7,613 |
Calls today: | 1 |
Files: | 12,789 |
Messages: | 5,685,991 |