Re: std.conv.to purity

2015-02-14 Thread ketmar via Digitalmars-d-learn
On Sat, 14 Feb 2015 11:29:28 +, Jack Applegame wrote: why std.conv.to is not pure? string foo(real v) pure { return v.to!string; } // Error: pure function 'foo' cannot call impure function 'std.conv.to!string.to!(real).to' 'cause float-string conversion is damned hard task. to perform

std.conv.to purity

2015-02-14 Thread Jack Applegame via Digitalmars-d-learn
why std.conv.to is not pure? string foo(real v) pure { return v.to!string; } // Error: pure function 'foo' cannot call impure function 'std.conv.to!string.to!(real).to'

Re: std.conv.to purity

2015-02-14 Thread Gary Willoughby via Digitalmars-d-learn
On Saturday, 14 February 2015 at 12:24:51 UTC, ketmar wrote: On Sat, 14 Feb 2015 11:29:28 +, Jack Applegame wrote: why std.conv.to is not pure? string foo(real v) pure { return v.to!string; } // Error: pure function 'foo' cannot call impure function 'std.conv.to!string.to!(real).to'

Re: std.conv.to purity

2015-02-14 Thread ketmar via Digitalmars-d-learn
On Sat, 14 Feb 2015 19:59:58 +, Gary Willoughby wrote: On Saturday, 14 February 2015 at 12:24:51 UTC, ketmar wrote: On Sat, 14 Feb 2015 11:29:28 +, Jack Applegame wrote: why std.conv.to is not pure? string foo(real v) pure { return v.to!string; } // Error: pure function 'foo'

Re: std.conv.to purity

2015-02-14 Thread Brad Roberts via Digitalmars-d-learn
While snprintf might be one thing that provides to be an interesting obstacle, the better answer to why std.conv.to isnt pure is that no one has invested the time to work through issues like that to make it so. It _should_ be pure. On 2/14/2015 12:32 PM, ketmar via Digitalmars-d-learn wrote: