www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9012] New: writef/format inconsistent with format specifier

reply d-bugmail puremagic.com writes:
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



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: -------
Nov 12 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9012




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: -------
Nov 12 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9012


hsteoh quickfur.ath.cx changed:

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



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: -------
Nov 23 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9012




01:40:39 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.
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: -------
Nov 24 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9012




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: -------
Dec 21 2012
prev sibling parent d-bugmail puremagic.com writes:
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



OK. Closed.

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