Phobos packages a bit confusing

retard re at tard.com.invalid
Sun Nov 29 11:12:50 PST 2009


Hi

after using D1 and Tango for couple of years we decided to experiment 
with D2 and Phobos in a small scale project. For some reason the mostly 
flat package hierarchy seemed rather confusing.

For instance, it took two of us 15 minutes to build a program that reads 
a line from user, converts the string to a natural number, adds one, and 
finally prints it to the screen. Entities like 'stdin' seem to have no 
documentation at all. What should I import to get it, what interfaces 
does it implement etc.

When writing this, I already forgot what package contained the to! 
template. My intuition says it should be in
 * std.stdint [int related operations]
 * std.format [number formats?]
 * std.typecons [we're constructing a int from a string]
 * std.string [the input was a string, maybe toInt is a string operation]
 * std.numeric [it's a numeric operation, isn't it]

I admit using higher level languages has made major damage to my brain 
("500.1".toInt anyone?), but still using Tango, Java, or C# seems rather 
intuitive, but in Phobos the set of packages and their contents feels 
more or less arbitrary. Is there anything that can be done?



More information about the Digitalmars-d mailing list