std.uni vs std.unicode and beyond?

Idan Arye GenericNPC at gmail.com
Tue May 21 13:27:58 PDT 2013


On Tuesday, 21 May 2013 at 19:40:03 UTC, eles wrote:
> On Tuesday, 21 May 2013 at 18:23:42 UTC, Dmitry Olshansky wrote:
>> 21-May-2013 22:12, Brad Anderson пишет:
>>> On Tuesday, 21 May 2013 at 17:53:02 UTC, Idan Arye wrote:
>> I see people have no idea what Unicode is about.
>> Unicode is not only the encoding - it's a de facto standard of 
>> internationalization and related algorithms. UTF is encoding.
>
> Good point, but this fact only supports the assertion that the 
> current state of phobos is even more messy than expected. So, a 
> bit of cleaning is required.
>
> Since we are at it, ascii is both a standard *and* an encoding 
> (well, the only one), so were should be put? in std.encoding.* 
> or in std.standard.*? maybe std.text.ascii? std.text.unicode? 
> std.text.utf?

`std.standard` is a bad name for a package. Sure, ASCII is a 
standard, but the fact that it is a standard has nothing to do 
with what the `*.ascii` module does - you won't find a function 
in `std.ascii` that sends an email to the committee with an 
improvement suggestion for the next edition.

Ofcourse, one can only claim that the only reason such function 
does not exist is that the ASCII standard would probably never 
see another update...

On the other hand, all the functions in `std.ascii` have 
something much do with the fact that ASCII is an encoding, so 
`std.encoding.ascii` is a good name.

Same with `*.unicode` - even though it has a better chance than 
the ASCII version, you see a function to mail a suggestion there 
either. And yes, it's an algorithm - but almost everything is an 
algorithm!

Unicode and ASCII, even if you can argue they are not exactly and 
only encodings, are *about* encoding - and that's why they fit in 
`std.encoding.*`.


More information about the Digitalmars-d mailing list