Programs in D are huge

bauss jacobbauss at gmail.com
Fri Aug 19 11:18:48 UTC 2022


On Friday, 19 August 2022 at 06:34:19 UTC, Patrick Schluter wrote:
> On Thursday, 18 August 2022 at 17:15:12 UTC, rikki cattermole 
> wrote:
>>
>> On 19/08/2022 4:56 AM, IGotD- wrote:
>>> BetterC means no arrays or strings library and usually in 
>>> terminal tools you need to process text. Full D is wonderful 
>>> for such task but betterC would be limited unless you want to 
>>> write your own array and string functionality.
>>
>> Unicode support in Full D isn't complete.
>>
>> There is nothing in phobos to even change case correctly!
>>
>> Both are limited if you care about certain stuff like 
>> non-latin based languages like Turkic.
>
> A general toupper/tolower for Unicode is doomed to fail. As 
> already mentioned Turkish has its specificity, but other 
> languages also have traps. In Greek toupper/tolower are not 
> reversible i.e. `x.toupper.tolower == x` is not guaranteed . 
> Some languages have 1 codepoint input and 2 codepoints as 
> result (German ß becomes SS in most cases, capital ẞ is not the 
> right choice in most cases).
> etc. etc.

That's why you should implementat formatting providers for 
languages that handle such things.

Like in C# you have the CultureInfo class that you can give to 
methods such as ToString, ToLower etc. which will correctly 
handle specific "cultures"

It's one thing D really misses, but is really hard to implement 
when it wasn't thought of to begin with. It should have been 
implemented alongside functions that may change between languages 
and cultures.


More information about the Digitalmars-d-learn mailing list