May 21, 2013 Re: std.uni vs std.unicode and beyond? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Idan Arye | On Tuesday, 21 May 2013 at 17:53:02 UTC, Idan Arye wrote:
> The problem is that people that need Unicode stuff see `std.utf` and assume that all Unicode related stuff are there.
I see (and experience myself) a lot of confusion over this. Dealing with strings a person constantly has to guess which of these modules has what they are looking for:
std.algorithm
std.ascii
std.conv
std.encoding
std.range
std.string
std.format
std.uni
std.utf
It's a mess. At least grouping the encoding stuff together would give it some structure.
|
May 21, 2013 Re: std.uni vs std.unicode and beyond? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brad Anderson | 21-May-2013 22:12, Brad Anderson пишет: > On Tuesday, 21 May 2013 at 17:53:02 UTC, Idan Arye wrote: > >> The problem is that people that need Unicode stuff see `std.utf` and >> assume that all Unicode related stuff are there. > > I see (and experience myself) a lot of confusion over this. Dealing with > strings a person constantly has to guess which of these modules has what > they are looking for: > > std.algorithm > std.ascii > std.conv > std.encoding > std.range > std.string > std.format > std.uni > std.utf > > It's a mess. At least grouping the encoding stuff together would give it > some structure. 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. -- Dmitry Olshansky |
May 21, 2013 Re: std.uni vs std.unicode and beyond? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dmitry Olshansky | On Tue, 21 May 2013 16:51:01 +0400
Dmitry Olshansky <dmitry.olsh@gmail.com> wrote:
> The pitch by deadalnix:
>
> I strongly push into renaming it to std.unicode . As said in the other thread : uni can be unicode, but also unique, union, unit, uniform, unix, unijambist, whatever.
>
Or a British University. :)
FWIW, I prefer "std.unicode", and I have absolutely no personal objections to having to change my code to match. And heck, it's easy enough to ease transition with:
module std.uni;
public import std.unicode;
alias std.unicode.foo foo;
alias std.unicode.bar bar;
pragma(msg, "Please import std.unicode instead of std.uni")
EOF
But that said, if people say "we don't need no steeenkin' module renaming!", I'm perfectly fine with that, too.
tl;dr: My preference is "std.unicode", but I don't really care.
|
May 21, 2013 Re: std.uni vs std.unicode and beyond? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On Tue, 21 May 2013 14:23:24 -0400, Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote: > module std.uni; > public import std.unicode; > alias std.unicode.foo foo; > alias std.unicode.bar bar; > pragma(msg, "Please import std.unicode instead of std.uni") > EOF from here: http://dlang.org/module.html#ImportDeclaration "All symbols from a publicly imported module are also aliased in the importing module. This means that if module D imports module C, and module C publicly imports module B which has the symbol bar, in module D you can access the symbol via bar, B.bar, and C.bar." -Steve |
May 21, 2013 Re: std.uni vs std.unicode and beyond? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Idan Arye | On 2013-05-21 19:53, Idan Arye wrote: > The problem is that people that need Unicode stuff see `std.utf` and > assume that all Unicode related stuff are there. I never can remember if I should look in std.utf or std.uni. That wouldn't change if it was renamed to std.unicode. -- /Jacob Carlborg |
May 21, 2013 Re: std.uni vs std.unicode and beyond? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dmitry Olshansky | std.algo std.uni // Ok or std.algorithm std.unicode // OK or std.algorithm std.uni --> WTF? - newbie |
May 21, 2013 Re: std.uni vs std.unicode and beyond? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On Tue, 21 May 2013 14:33:48 -0400
"Steven Schveighoffer" <schveiguy@yahoo.com> wrote:
> On Tue, 21 May 2013 14:23:24 -0400, Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote:
>
> > module std.uni;
> > public import std.unicode;
> > alias std.unicode.foo foo;
> > alias std.unicode.bar bar;
> > pragma(msg, "Please import std.unicode instead of std.uni")
> > EOF
>
> from here: http://dlang.org/module.html#ImportDeclaration
>
> "All symbols from a publicly imported module are also aliased in the importing module. This means that if module D imports module C, and module C publicly imports module B which has the symbol bar, in module D you can access the symbol via bar, B.bar, and C.bar."
>
Nice. Is that a new thing, or have I managed to overlook it for years?
|
May 21, 2013 Re: std.uni vs std.unicode and beyond? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On Tue, 21 May 2013 14:54:42 -0400, Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote: > On Tue, 21 May 2013 14:33:48 -0400 > "Steven Schveighoffer" <schveiguy@yahoo.com> wrote: >> "All symbols from a publicly imported module are also aliased in the >> importing module. This means that if module D imports module C, and >> module C publicly imports module B which has the symbol bar, in >> module D you can access the symbol via bar, B.bar, and C.bar." >> > > Nice. Is that a new thing, or have I managed to overlook it for > years? Like I did? Yes :) I think I became aware about a couple years ago in one of those periodic discussions on how to migrate the current flat hierarchy to a nested one. -Steve |
May 21, 2013 Re: std.uni vs std.unicode and beyond? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dmitry Olshansky | 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?
|
May 21, 2013 Re: std.uni vs std.unicode and beyond? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dmitry Olshansky | 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:
>>
>>> The problem is that people that need Unicode stuff see `std.utf` and
>>> assume that all Unicode related stuff are there.
>>
>> I see (and experience myself) a lot of confusion over this. Dealing with
>> strings a person constantly has to guess which of these modules has what
>> they are looking for:
>>
>> std.algorithm
>> std.ascii
>> std.conv
>> std.encoding
>> std.range
>> std.string
>> std.format
>> std.uni
>> std.utf
>>
>> It's a mess. At least grouping the encoding stuff together would give it
>> some structure.
>
> 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.
If I see a module called "utf" and I don't see a module called "unicode", I automatically assume that "utf" contains Unicode related stuff as well. And visa versa - if I see "unicode" and not "utf", I assume "unicode" contains the UTF stuff.
Sure, they are not the same - but they are related enough that people will expect them to share a module.
|
Copyright © 1999-2021 by the D Language Foundation