renoX: > The lack of pretty printing of enums is a pet peeves of mine in several > languages, too bad that Tart is one of those.
D isn't one of those any more, I presume :-) > I haven't found what happen in case of integer overflow or out of bound array > index though, I hope it does the right thing and throw an exception (come on: > *Ada* did it!!). I hope they will get this right. D looks hopeless on this. > I hope it does the right thing and initialize by default ints and floats to > zero > (Nan initialisation for D's float is a big mistake: even Andrei makes a > mistake about this in his book!). The initialization of FP to NaN has caused me only two related troubles: - While porting to D a C program that assumed a global FP array to be initialized to zeros. - Binary super-inflation caused by a large global FP array (being initialized to NaN instead of zeros means the compiler puts all the NaNs in the binary. In this case I'd like a little routine to initialize the array to NaNs before the main). Having FP initialized to NaN is a bit less handy than having them initialized to 0.0 (most times a zero is more useful than a NaN), but in the D compiler (unlike C#) there is no logic to spot not initialized variables. So the next best thing after C# behaviour to avoid initialization-related bugs is to initialize to a value that's poisonous and sticky like NaN, that allows you to find the initialization bug quickly. So unless D adds the refined logic similar to C# compilers, I think initializing FP to NaN is good. Tart contains several good ideas. Bye, bearophile
