[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2016-03-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4532

Dmitry Olshansky  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||dmitry.o...@gmail.com
 Resolution|--- |WORKSFORME

--- Comment #19 from Dmitry Olshansky  ---
Was fixed quite sometime ago.

--


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2014-08-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4532

hst...@quickfur.ath.cx changed:

   What|Removed |Added

 CC||hst...@quickfur.ath.cx

--- Comment #17 from hst...@quickfur.ath.cx ---
Update: as of today, phobos git HEAD really has only 2 calls to doFormat left:
std.stream.Stream.writefx(), and std.stdio.writefx(), the latter of which is
private and apparently unused (I deleted it and all unittests pass).

So here's a pull that eliminates std.stdio.writefx():
https://github.com/D-Programming-Language/phobos/pull/2403

Once that's done, there will only be std.stream.Stream.writefx() left before we
can get rid of doFormat forever.

--


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2014-08-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4532

--- Comment #18 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/16822243a1e18f1df2f0e02e60bcfaa3fb252a30
Remove unused private writefx() function.

This eliminates the 3rd last usage of doFormat in Phobos, thus inching
us closer to fully fixing bug #4532.

https://github.com/D-Programming-Language/phobos/commit/df3fbff9488afa12b9f3b6ca4de5cd46f2e240dd
Merge pull request #2403 from quickfur/issue4532b

Remove unused private writefx() function.

--


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2013-01-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532



--- Comment #16 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-01-24 
16:22:09 PST ---
It seems all code samples in this issue are fixed.

There seems to be very few doFormat calls left in Phobos:

std\stdio.d:1498:   std.format.doFormat(putc, arguments, argptr);
std\stdio.d:1533:   std.format.doFormat(putcw, arguments, argptr);
std\stream.d:1209:  doFormat(doFormatCallback,arguments,argptr);

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


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532



--- Comment #13 from bearophile_h...@eml.cc 2012-04-20 14:41:35 PDT ---
This seems another example of the same problem:


import std.stdio: writeln;
import std.conv: text;
struct Foo {}
void main() {
Foo* f = new Foo;
writeln(f);
writeln(text(f));
}


Output:

15D2FD0
22884304

Expected output:

15D2FD0
15D2FD0

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


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2012-04-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532



--- Comment #14 from bearophile_h...@eml.cc 2012-04-20 14:49:05 PDT ---
I've taken a look here:
https://github.com/D-Programming-Language/phobos/pull/231

Kenji Hara sasy:

The same name with core.stdc.sprintf is very confusing. And std.string.format 
returns new string, but core.stdc.sprintf write the formatted string into 
specified buffer. The two behaviors are quite different.


Andrei Alexandrescu says:

There's no problem with core.stdc.sprintf bearing the same name as 
std.format.sprintf. Phobos has had such duplicate names for years without a 
problem.


I agree that Phobos has some name clashes. But I don't agree it's a good thing.
It should be avoided if possible for newly added names.
And I agree the behavior of the new functions is different from the C
functions. So I agree with Kenji Hara, they should have different names.

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


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2012-04-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532


Stewart Gordon s...@iname.com changed:

   What|Removed |Added

 CC||jmdavisp...@gmx.com


--- Comment #12 from Stewart Gordon s...@iname.com 2012-04-10 03:38:13 PDT ---
*** Issue 4754 has been marked as a duplicate of this issue. ***

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


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2012-04-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532



--- Comment #9 from Stewart Gordon s...@iname.com 2012-04-09 13:54:23 PDT ---
*** Issue 7877 has been marked as a duplicate of this issue. ***

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


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2012-04-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532



--- Comment #10 from Kenji Hara k.hara...@gmail.com 2012-04-09 21:38:54 PDT 
---
*** Issue 7881 has been marked as a duplicate of this issue. ***

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


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2012-04-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532



--- Comment #11 from Kenji Hara k.hara...@gmail.com 2012-04-09 21:40:28 PDT 
---
Issue 6595 was a bug report only about std.string.format/sformat functions.

From issue 6595 comment #0:
 This enhancement issue is nearly a bug report.
 
 format() and sformat() use std.format.doFormat as their implementations, but 
 it
 is old feature, and its features are fewer than formatValue family.
 
 And it is causing not a few issues:
 bug 3715 - std.string.format can't use const/immutable toString functions
 bug 4266 - add support for structs in std.format.doFormat
 bug 4532 - Position specifiers don't work in format
 bug 5444 - std.string.format: arguments without format specifier appended to
 result
 bug 5970 - fix BigInt.toString
 
 I think format() should be implemented just appender and formattedWrite like
 follows:
 
 string format(Char, Args...)(in Char[] fmt, Args args)
 {
 auto w = appender!string();
 formattedWrite(w, fmt, args);
 return w.data;
 }
 
 This 'format()' provides just the same features as writef(ln) functions about
 formatting.
 
 And sformat() also could replace like follows:
 
 char[] sformat(Char, Args...)(char[] buf, in Char[] fmt, Args args)
 {
 size_t i;
 void sink(const(char)[] s) {
 if (buf.length  i + s.length)
 onRangeError(std.string.sformat, 0);
 buf[i .. i + s.length] = s[];
 i += s.length;
 }
 formattedWrite(sink, fmt, args);
 return buf[0 .. i];
 }

And I proposed a pull and it is discussed in here:
https://github.com/D-Programming-Language/phobos/pull/231

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


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2012-04-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532


Stewart Gordon s...@iname.com changed:

   What|Removed |Added

 CC||bugzi...@kyllingen.net


--- Comment #4 from Stewart Gordon s...@iname.com 2012-04-01 15:04:29 PDT ---
*** Issue 5687 has been marked as a duplicate of this issue. ***

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


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2012-04-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532


Stewart Gordon s...@iname.com changed:

   What|Removed |Added

 CC||k.hara...@gmail.com


--- Comment #5 from Stewart Gordon s...@iname.com 2012-04-01 15:04:46 PDT ---
*** Issue 6595 has been marked as a duplicate of this issue. ***

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


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2012-04-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532


Stewart Gordon s...@iname.com changed:

   What|Removed |Added

 CC||tomeks...@gmail.com


--- Comment #6 from Stewart Gordon s...@iname.com 2012-04-01 15:05:31 PDT ---
*** Issue 5444 has been marked as a duplicate of this issue. ***

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


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2012-04-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532


Stewart Gordon s...@iname.com changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #7 from Stewart Gordon s...@iname.com 2012-04-01 15:05:44 PDT ---
*** Issue 7571 has been marked as a duplicate of this issue. ***

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


[Issue 4532] std.string.format, std.stream methods, etc. still use the old doFormat instead of formattedWrite

2012-04-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4532


Stewart Gordon s...@iname.com changed:

   What|Removed |Added

 CC||andrej.mitrov...@gmail.com


--- Comment #8 from Stewart Gordon s...@iname.com 2012-04-01 15:06:00 PDT ---
*** Issue 7620 has been marked as a duplicate of this issue. ***

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