From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!NfdNc+Wt3EVimQY6QC0FdA.user.46.165.242.75.POSTED!not-for-mail From: Blady Newsgroups: comp.lang.ada Subject: Re: [ANN] UXStrings package available (UXS_20220226). Date: Thu, 24 Mar 2022 22:13:31 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <52dec3b7-d1ab-4637-a96e-7bde3cab95f4n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: gioia.aioe.org; logging-data="12620"; posting-host="NfdNc+Wt3EVimQY6QC0FdA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:63632 List-Id: Le 23/03/2022 à 10:42, Vincent D. a écrit : > Le mardi 1 mars 2022 à 21:47:51 UTC+1, Blady a écrit : >> 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 bytes and characters. Hello Vincent, I had some thoughts about "generic" Character concept and felt the user would mostly choose Unicode representation (same as Wide_Wide_Character) which brings the maximum available character set at a small cost of 4 bytes. Ada standard library comes will all sort of conversion subprograms to ASCII, Latin-1... 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? egards, Pascal.