Shouldn't have IsAlpha() from std.uni has a different name to avoid confusing from std.ascii?

Uranuz via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 22 01:59:55 PDT 2014


On Thursday, 21 August 2014 at 15:36:41 UTC, ketmar via 
Digitalmars-d wrote:
> On Thu, 21 Aug 2014 15:27:46 +0000
> MacAsm via Digitalmars-d <digitalmars-d at puremagic.com> wrote:
>
>> Any thoughts? I don't know if I'm missing something but two 
>> functions (and not methods) with same name is very bad.
> they doing much the same, but for different character sets. two
> different names will just confuse users.
>
> you can use fully qualified names and/or local imports to use 
> exactly
> what you want. something like:
>
>   void myFunc (char ch) {
>     import std.ascii;
>     if (std.ascii.isAlpha(ch)) ...
>   }
>
> local imports rocks! ;-)

It's useful advice. But the only problem that I experience from 
time to time that local imports become source of linker error 
that are not very easy to find. But language descision for this 
is good and I like it a lot!


More information about the Digitalmars-d mailing list