My Kingdom For ...
Derek Parnell
derek at nomail.afraid.org
Thu Feb 21 15:00:23 PST 2008
On Thu, 21 Feb 2008 23:55:29 +0100, Ary Borenszweig wrote:
>> I guess I was. I suppose I was saying, let's make "== null" illegal
>> for /all/ types. "== null" just isn't needed, because in /all/ cases,
>> "is null" works.
>
> That's even better than an error. :-)
>
> But programmers are used to use "==" for comparisons with null...
> Another alternative would be for the compiler to rewrite "== null" as
> "is null", always.
For what its worth, I'm also in the camp that feels that "== null" and "is
null" should be treated semantically the same by the language. I realize
that his would add a bit of complexity in a compiler that automatically
translates "==" into an opEquals() call.
--
Derek
(skype: derek.j.parnell)
Melbourne, Australia
22/02/2008 9:58:03 AM
More information about the Digitalmars-d
mailing list