https://d.puremagic.com/issues/show_bug.cgi?id=9493



--- Comment #7 from Peter Alexander <[email protected]> 2014-02-09 
13:42:32 PST ---
(In reply to comment #6)
> I suppose, though maybe it should say in the documentation that such edge 
> cases
> may occur, using this as an example.

Where do you draw the line with such things though? ints comparing with dchars
is part of the language. If you add a warning about it in canFind then do you
add it in every functions that does a comparison?

All of the following compile and the assertions hold.

// Note: 32 == ' ' in ASCII
assert(count([0, 16, 32, 64], ' ') == 1);
assert(commonPrefix([32, 32, 30], "  x") == "  ");
assert(equal([32], " "));
assert([32].filter!(x => x != ' ').empty);

There are many more situations where this can come up. I can't see the benefit
of warning about it in the documentation. D programmers just need to be aware
that characters are a form of integer and that they can be compared.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to