Reply to bearophile,

writefln, writeln and the things of Tango are nice and cute and safe,
but if I have to save 250 MB of numbers (or 1 GB of them, or even
more) then performance is important, and those cute functions are
2-3-5 times slower than printf. This means printf can save me minutes
of running time. So I use printf. But if I use printf in C and I
write:

int main() {
float f = 1.2345;
printf("%d\n", f);
return 0;
}
The compiler says me:
warning: format '%d' expects type 'int', but argument 2 has type
'double'
While DMD compiles it silently. Better to quickly add such
warning/error to D compilers too.


It would be interesting to write a template that takes a static format string (using writef syntax) and, based on its argument tuple to generates a trivial wrapper around printf with a guarantied correct (printf syntax) format string.


Reply via email to