Bug 2310 – Inconsistent formatting of arrays in std.stdio.write() and std.conv.to!(string)()

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-08-23T17:22:00Z
Last change time
2015-06-09T01:20:08Z
Assigned to
andrei
Creator
snake.scaly

Comments

Comment #0 by snake.scaly — 2008-08-23T17:22:35Z
The documentation for std.stdio.write() says: "... for each argument ... format the argument (as per to!(string)(arg)) ...". Nevertheless, arrays are formatted differently when using std.stdio.write() and std.conv.to!(string)(): import std.stdio; import std.conv; void main() { writeln([1,2,3]); // prints [1 2 3] writeln(to!(string)([1,2,3])); // prints [1,2,3] } I expect the formatting to be identical.
Comment #1 by andrei — 2010-09-26T11:28:09Z
Resolved by using a ", " separator by default in to!string. http://www.dsource.org/projects/phobos/changeset/2052