www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - std.format.doFormat and std.format.formattedWrite

reply Stewart Gordon <smjg_1998 yahoo.com> writes:
There are several bug reports along the lines of std.stdio.writef* and
std.string.format 
and stream writef* functions behaving inconsistently with each other.

So far I've found:

http://d.puremagic.com/issues/show_bug.cgi?id=4532
http://d.puremagic.com/issues/show_bug.cgi?id=5687
http://d.puremagic.com/issues/show_bug.cgi?id=6595
http://d.puremagic.com/issues/show_bug.cgi?id=7571
http://d.puremagic.com/issues/show_bug.cgi?id=7620

Really, they're all one bug, namely the use of two divergent functions that
have the same 
purpose: doFormat and formattedWrite.

Under D1, we had only doFormat.  In D2, formattedWrite has superseded doFormat; 
nonetheless, some bits of Phobos are still using doFormat.

6595 is "std.string.format() and sformat() are obsolete".  It seems to be
advocating 
killing doFormat once and for all.  However, the pull request doesn't go
anywhere near 
this far, and there is even a call to doFormat in the unchanged lines of the
pull. 
Really, it only makes sense to get the migration from doFormat to
formattedWrite finished 
once and for all.

But meanwhile, what to do with these duplicate bug reports?  Change the summary
4532 to 
reflect the true nature of the problem and then dupe the others to it?  Or open
a new bug 
report that is straight and to the point about it, and dupe those to it?  Or
list the old 
bugs as dependencies rather than dupes of the new root cause bug?

(Example from years ago of manifestations of a bug being done as dependencies:
https://bugzilla.mozilla.org/show_bug.cgi?id=57724
)

Stewart.
Mar 01 2012
parent =?utf-8?Q?Simen_Kj=C3=A6r=C3=A5s?= <simen.kjaras gmail.com> writes:
On Thu, 01 Mar 2012 20:55:14 +0100, Stewart Gordon <smjg_1998 yahoo.com>  
wrote:

 There are several bug reports along the lines of std.stdio.writef* and  
 std.string.format and stream writef* functions behaving inconsistently  
 with each other.

 So far I've found:

 http://d.puremagic.com/issues/show_bug.cgi?id=4532
 http://d.puremagic.com/issues/show_bug.cgi?id=5687
 http://d.puremagic.com/issues/show_bug.cgi?id=6595
 http://d.puremagic.com/issues/show_bug.cgi?id=7571
 http://d.puremagic.com/issues/show_bug.cgi?id=7620

 Really, they're all one bug, namely the use of two divergent functions  
 that have the same purpose: doFormat and formattedWrite.

 Under D1, we had only doFormat.  In D2, formattedWrite has superseded  
 doFormat; nonetheless, some bits of Phobos are still using doFormat.

 6595 is "std.string.format() and sformat() are obsolete".  It seems to  
 be advocating killing doFormat once and for all.  However, the pull  
 request doesn't go anywhere near this far, and there is even a call to  
 doFormat in the unchanged lines of the pull. Really, it only makes sense  
 to get the migration from doFormat to formattedWrite finished once and  
 for all.

 But meanwhile, what to do with these duplicate bug reports?  Change the  
 summary 4532 to reflect the true nature of the problem and then dupe the  
 others to it?  Or open a new bug report that is straight and to the  
 point about it, and dupe those to it?  Or list the old bugs as  
 dependencies rather than dupes of the new root cause bug?

 (Example from years ago of manifestations of a bug being done as  
 dependencies:
 https://bugzilla.mozilla.org/show_bug.cgi?id=57724
 )
I'd say change 4532.
Mar 01 2012