Thread overview
[Issue 9012] New: writef/format inconsistent with format specifier
Nov 13, 2012
Andrej Mitrovic
Nov 13, 2012
Andrej Mitrovic
Nov 24, 2012
Andrej Mitrovic
Dec 23, 2012
Kenji Hara
November 13, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9012

           Summary: writef/format inconsistent with format specifier
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: andrej.mitrovich@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-11-12 16:50:03 PST ---
2.060 and git head:

import std.string;
import std.stdio;

void main()
{
    writefln("Set!%s(%(%s, %))", "int", [1, 2]);  // Set!int(1, 2)
    string s = format("Set!%s(%(%s, %))", "int", [1, 2]);  // format error
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 13, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9012



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-11-12 16:51:03 PST ---
xformat works ok though.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 24, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9012


hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh@quickfur.ath.cx


--- Comment #2 from hsteoh@quickfur.ath.cx 2012-11-23 16:22:35 PST ---
std.string.xformat is the function that's compatible with std.format. We really should deprecate std.string.format or something, and replace it with xformat. The current std.string.format sucks and every now and then causes newbie confusion when the same format string works in writeln but not in std.string.format (or it works differently).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 24, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9012



--- Comment #3 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-11-24 01:40:39 PST ---
(In reply to comment #2)
> std.string.xformat is the function that's compatible with std.format. We really should deprecate std.string.format or something, and replace it with xformat.

This should be sorted soon enough: https://github.com/D-Programming-Language/phobos/pull/939

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 21, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9012



--- Comment #4 from hsteoh@quickfur.ath.cx 2012-12-21 07:38:30 PST ---
The pull has been merged; I just tested the code and it's working now. Should this bug be closed?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 23, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9012


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #5 from Kenji Hara <k.hara.pg@gmail.com> 2012-12-23 08:17:50 PST ---
OK. Closed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------