On 4/18/12, Jonathan M Davis <[email protected]> wrote:
> that is null == "".

Wow, I don't understand this, why is comparison with null allowed with
the equals operator for strings?

import std.stdio;

class Foo { }
void main()
{
    Foo foo;
    writeln(foo == null);  // compile error, as it should be
    writeln("" == null);  // true (why is this allowed?)
    writeln("" is null);  // false
}

Shouldn't the second call be illegal? That would remove ambiguities
between null strings and empty strings afaict.

Reply via email to