www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - std.stream.isdigit conflicts with std.ctype.isdigit

reply someone nospam.aol.com writes:
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 ?
Nov 11 2005
parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
<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.
Nov 11 2005
parent James Dunne <james.jdunne gmail.com> writes:
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
Nov 11 2005