On Wed, May 16, 2012 at 09:17:17PM +0400, Gor Gyolchanyan wrote:
> On Wed, May 16, 2012 at 9:07 PM, Steven Schveighoffer
> <[email protected]>wrote:
> 
> > On Wed, 16 May 2012 12:21:27 -0400, Gor Gyolchanyan <
> > [email protected]> wrote:
> >
> >
> >> if("" != []) assert("".length != 0);
> >>
> >> Will this fail?
> >>
> >
> > No.  Ambiguities only come into play when you use 'is'.  I highly
> > recommend not using 'is' for arrays unless you really have a good
> > reason, since two slices can be 'equal' but 'point at different
> > instances'.
[...]
> Doesn't assert("".length != 0) look extremely counter-intuitive?
[...]

Code:
        import std.stdio;
        void main() {
                writeln("" == []);
                writeln("" != []);
                writeln("".length);
        }

Output:
        true
        false
        0

Where's the problem?


T

-- 
Recently, our IT department hired a bug-fix engineer. He used to work for 
Volkswagen.

Reply via email to