Re: Avoiding == and = mixup in if statements
Re: Avoiding == and = mixup in if statements
- Subject: Re: Avoiding == and = mixup in if statements
- From: Chris Pavicich <email@hidden>
- Date: Thu, 20 May 2004 23:47:28 -0400
Why not write:
if ( nil == myObject)
{
doSomething();
}
If you miss the extra '=' the compiler will complain.
--CMP
On May 20, 2004, at 22:10, Christoffer Lerno wrote:
Java disallows stuff like
if (myObject=nil) { dosomething }
Is it possible to maybe disallow the same potential error when I'm
writing obj-c programs? Could I do something with the pre-processor
perhaps?
/Christoffer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.