Phobos' std.conv.text functions

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 31 10:45:34 PDT 2015


On Mon, Aug 31, 2015 at 07:40:24PM +0200, Timon Gehr via Digitalmars-d wrote:
> On 08/31/2015 05:35 PM, H. S. Teoh via Digitalmars-d wrote:
[...]
> Also, the proposed rewrite does not fix the problem. (I haven't tested
> it, but AFAIU, the following code is neither rejected by the pull, nor
> does it print "123".)
> 
> import std.stdio;
> 
> void main(){
>     string text="123";
>     void foo(){
>         import std.conv;
>         writeln(text());
>     }
>     foo();
> }
> 
> (Also, essentially the same logic occurs in three distinct places in
> the new code.)

This code should *not* print "123", because text() is explicitly a
function call, but the local variable 'text' is not a function.


T

-- 
Windows: the ultimate triumph of marketing over technology. -- Adrian von Bidder


More information about the Digitalmars-d mailing list