Thread overview
std.stream.isdigit conflicts with std.ctype.isdigit
Nov 11, 2005
someone
Nov 11, 2005
James Dunne
November 11, 2005
Hello,

I am learning the D language, and so far, I must say I really like it. I think it is very well designed and contrarily to some other comparable languages it doesn't get in the way.

I am having a compilation problem though. In my main source, I wrote :

import std.stream;
import std.file;
import std.ctype;
import std.string;
import mintl.slist;

However, the compiler tells me :
..\src\phobos\std\stream.d(2912): function std.stream.isdigit conflicts with
std.ctype.isdigit at ...\src\phobos\std\ctype.d(32)

Is it a bug in the Phobos library, or did I forget something ?


November 11, 2005
<someone@nospam.aol.com> wrote in message news:dl27o4$j12$1@digitaldaemon.com...
> However, the compiler tells me :
> ..\src\phobos\std\stream.d(2912): function std.stream.isdigit conflicts
> with
> std.ctype.isdigit at ...\src\phobos\std\ctype.d(32)
>
> Is it a bug in the Phobos library, or did I forget something ?

Ha-HA!  Another reason to fix the "private declaration at module level" bug. Turns out, std.stream defines a private isdigit() function at module level. This technically should not be visible to other modules, _period_; but because of this bug, it conflicts with std.ctype.isdigit().

For the time being you'll have to call isdigit() with its fully qualified name, i.e.

if(std.ctype.isdigit(someChar))
...

Hopefully this bug gets fixed.


November 11, 2005
Jarrett Billingsley wrote:
> <someone@nospam.aol.com> wrote in message news:dl27o4$j12$1@digitaldaemon.com...
> 
>>However, the compiler tells me :
>>..\src\phobos\std\stream.d(2912): function std.stream.isdigit conflicts with
>>std.ctype.isdigit at ...\src\phobos\std\ctype.d(32)
>>
>>Is it a bug in the Phobos library, or did I forget something ?
> 
> 
> Ha-HA!  Another reason to fix the "private declaration at module level" bug. Turns out, std.stream defines a private isdigit() function at module level. This technically should not be visible to other modules, _period_; but because of this bug, it conflicts with std.ctype.isdigit().
> 
> For the time being you'll have to call isdigit() with its fully qualified name, i.e.
> 
> if(std.ctype.isdigit(someChar))
> ...
> 
> Hopefully this bug gets fixed. 
> 
> 

Straw that broke the camel's back? =P