import std.stdio; void main() { int[] x = [1,2,3]; int[3] y = [1,2,3]; int* z = [1,2,3]; // work, incorrectly writefln("%3.2f", [1,2,3]); writefln("%3.2f", x); writefln("%3.2f", y); writefln("%d", [1,2,3]); writefln("%d", x); writefln("%d", y); writefln("--"); // fail, correctly writefln("%3.2f", z); writefln("%d", z); writefln("%3.2f", ['f','o','o']); }
writefln("%d", [1,2,3]) works as designed - arrays pass down the format spec to each of their elements. http://www.dsource.org/projects/phobos/changeset/1998 takes care of the rest.