Pointers vs. References
Bill Baxter
dnewsgroup at billbaxter.com
Wed Jun 13 20:31:14 PDT 2007
Myron Alexander wrote:
> Bill Baxter wrote:
>>
>> x == y ===> (x is y || x.opEquals(y))
>>
>
> I prefer that the compiler does not rewrite my code.
>
> There is nothing wrong with the current syntax, it's just different from
> what most people here are used to. If Walter changed '==' to be a
> reference check, then it would mean '==' works differently for different
> types. That inconsistency would kick up a hurricane - precisely what
> happened in Java.
>
> D does get this one right but a warning would be nice.
But '==' *does* work differently for different types. Already.
Anyway, yeh, I'd be happy with a warning (or an error really -- unless
someone can think of a case where you really _want_ to crash your
program like that).
--bb
More information about the Digitalmars-d
mailing list