D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7571 - No uniformity of array textual representation
Summary: No uniformity of array textual representation
Status: RESOLVED DUPLICATE of issue 4532
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P2 minor
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-24 05:07 UTC by bearophile_hugs
Modified: 2012-04-01 15:05 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2012-02-24 05:07:07 UTC
I am not sure if this is a small bug or if this is "as designed". Close it if this is working as designed.


D2 code:

import std.stdio, std.conv, std.string;
void main() {
    auto a = [1, 2, 3];
    writeln(a);
    writefln("%s", a);
    writeln(text(a));
    writeln(format("%s", a));
}


The output given by DMD 2.059head:

[1, 2, 3]
[1, 2, 3]
[1, 2, 3]
[1,2,3]


I think writefln("%s") and format("%s") should give the same output. So I think here format("%s") should add a space after the comma.
Comment 1 Stewart Gordon 2012-04-01 15:05:44 UTC

*** This issue has been marked as a duplicate of issue 4532 ***