• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Logical and - second operator evaluated?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Logical and - second operator evaluated?


  • Subject: Re: Logical and - second operator evaluated?
  • From: Clark Cox <email@hidden>
  • Date: Sun, 1 Mar 2009 12:34:41 -0800

On Sun, Mar 1, 2009 at 12:06 PM, Martijn van Exel <email@hidden> wrote:
> Hi devs,
>
> I can't seem to get away with
>                if(timer!=nil && [timer isValid]) [timer invalidate];
> if the timer object does not exist.
> I'm not used to the second operator of the && even being evaluated if the
> first one evaluates false (Java, .NET). This is not the case in (Obj)C?

No, just as in C (and C++, when operator overloading isn't involved),
the second operand to the && operator is never evaluated if the first
evaluates to zero. What, exactly, is going wrong?

--
Clark S. Cox III
email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Logical and - second operator evaluated?
      • From: Martijn van Exel <email@hidden>
References: 
 >Logical and - second operator evaluated? (From: Martijn van Exel <email@hidden>)

  • Prev by Date: Re: Logical and - second operator evaluated?
  • Next by Date: Re: Logical and - second operator evaluated?
  • Previous by thread: Re: Logical and - second operator evaluated?
  • Next by thread: Re: Logical and - second operator evaluated?
  • Index(es):
    • Date
    • Thread