2012/7/1 d coder :
> Thanks Kenji, I will use xformat. BTW, why is it named "x"format? Would not
> "s"format be a better name? Where "s" could stand for string.
eXtended format.
> Also I feel, std.string.format should work for BitArray and BigInt too. Both
> these types are defined as part of pho
Thanks Kenji, I will use xformat. BTW, why is it named "x"format? Would not
"s"format be a better name? Where "s" could stand for string.
Also I feel, std.string.format should work for BitArray and BigInt too.
Both these types are defined as part of phobos.
Regards
- Puneet
std.string.format uses std.format.doFormat, and it is based on RTTI.
On the other hand, writeln/writefln uses std.format.formattedWrite and
formatValue, they are based on Compile Time Reflection.
So the results are different.
In 2.060head, std.string.xformat is added, and it works as like writefln
I have files a phobos bug report.
http://d.puremagic.com/issues/show_bug.cgi?id=8326
Regards
- Puneet
Greetings
std.string.format throws runtime exception for BigInt and for BitArray
types even though writefln works fine. The run-time error says
std.format.FormatException@std/format.d(4744): Can't convert
std.bigint.BigInt to string: "string toString()" not defined
Here is a small test case.
Reg