http://d.puremagic.com/issues/show_bug.cgi?id=4666
--- Comment #3 from bearophile_h...@eml.cc 2010-10-16 15:34:55 PDT --- It's important to give a good textual representation to Tuples, to avoid a very cluttered textual output. On the other hand defining a printing function to print tuples is not so natural. So an alternative solution is to give each Tuple a mutable static string argument, that for a Tuple defined as: Tuple!(double, "x", double, "y") gets automatically initialized to something like: "Tuple!(double,\"x\",double,\"y\")" But later may be modified by the programmer to something different. The tuple toString may just always prepend this string to the textual representation of the Tuple. Allowing something like this: void main() { import std.stdio: writeln; import std.typecons: Tuple; void main() { alias Tuple!(double, "x", double, "y") Point; writeln(p.__name); // prints: Tuple!(double,"x",double,"y") auto p = Point(1, 2); writeln(p); // prints: Tuple!(double,"x",double,"y")(1, 2) Point.__name = "Point"; writeln(p.__name); // prints: Point writeln(p); // prints: Point(1, 2) } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------