int opEquals(Object), and other legacy ints

Stewart Gordon smjg_1998 at yahoo.com
Thu Jul 20 12:07:53 PDT 2006


There seem to be a number of leftovers from before we had a bool type, 
and many people were using the int type to pass booleans around.

The most obvious is int opEquals(Object) defined in the Object class. 
Changing this'll break a considerable amount of existing code - but then 
again, the 0.163 change of making imports private by default has done 
this already.

But there are many functions in Phobos that can be cleaned up a bit 
without doing much harm.  Just to name a few....

std.string.iswhite
std.string.inPattern
std.ctype.isalnum (indeed, most of the functions in std.ctype)
std.file.exists
std.file.isfile
std.file.isdir
std.intrinsic.bt
std.intrinsic.btc
std.intrinsic.btr
std.intrinsic.bts
std.math.isnan (and other is* functions)
std.math.signbit

Going through the other modules will probably reveal many more, but I 
haven't checked.

Stewart.



More information about the Digitalmars-d-bugs mailing list