My interpretation of tdpl p57:

'is' compares for alias equality for arrays and classes.
Otherwise they are the same.

So should next code have same behavior if I will use is instead of ==

import std.stdio;
import std.string;

void main()
{
        getchar();
}

void getchar()
{
        string x;
        if ((x = stdin.readln().chomp) == "q")
                writeln("it's is q");
        else
                writeln("Not q");
}

In case I am using is, I have never get first if expression is true.

Reply via email to