Re: Odd to!string call

2010-12-26 Thread Pelle
On 12/21/2010 07:38 PM, Andrej Mitrovic wrote: I found this by accident: import std.stdio; import std.conv; void main() { writeln(to!string(2, 2)); // writes 10 writeln(to!string(1, 0)); // std.conv.ConvException: Radix error } I'm not sure why "std.conv.to" would even take multipl

Re: Odd to!string call

2010-12-21 Thread Andrej Mitrovic
And yes i know writeln() doesn't need std.conv, writeln could be any other function expecting a string. On 12/21/10, Andrej Mitrovic wrote: > Right. Thanks, guys. > > I do see how this could possibly cause bugs for the uninitiated. > Someone who is new to D might attempt to use to!string with mul

Re: Odd to!string call

2010-12-21 Thread Andrej Mitrovic
Right. Thanks, guys. I do see how this could possibly cause bugs for the uninitiated. Someone who is new to D might attempt to use to!string with multiple arguments, and end up with buggy code like this: import std.stdio; import std.conv; void main() { int x = 2; int y = 4; // more

Re: Odd to!string call

2010-12-21 Thread Simen kjaeraas
Andrej Mitrovic wrote: I found this by accident: import std.stdio; import std.conv; void main() { writeln(to!string(2, 2)); // writes 10 writeln(to!string(1, 0)); // std.conv.ConvException: Radix error } I'm not sure why "std.conv.to" would even take multiple arguments. Bugzilla?

Re: Odd to!string call

2010-12-21 Thread Steven Schveighoffer
On Tue, 21 Dec 2010 13:38:06 -0500, Andrej Mitrovic wrote: I found this by accident: import std.stdio; import std.conv; void main() { writeln(to!string(2, 2)); // writes 10 writeln(to!string(1, 0)); // std.conv.ConvException: Radix error } I'm not sure why "std.conv.to" would even

Odd to!string call

2010-12-21 Thread Andrej Mitrovic
I found this by accident: import std.stdio; import std.conv; void main() { writeln(to!string(2, 2)); // writes 10 writeln(to!string(1, 0)); // std.conv.ConvException: Radix error } I'm not sure why "std.conv.to" would even take multiple arguments. Bugzilla?