• 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: C question for you old guys ;-)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C question for you old guys ;-)


  • Subject: Re: C question for you old guys ;-)
  • From: Greg Hurrell <email@hidden>
  • Date: Thu, 12 Jun 2003 09:07:05 +0930

What about this one?

#define unless(expr) if(!(expr))

The "unless" language construct is one thing that I miss from Perl. It allows you the flexibility of choosing the construct that best suits your needs at a given moment, like:

unless([task fails])
{
NSLog(@"Success!");
}

...and the alternative:

if([task fails])
{
NSLog(@"Failure!");
}

So your selection depends which is more important to you: the truth or the falsity of the expression being evaluated. I for one wish that "unless" was a real language keyword in Objective-C.

Cheers
Greg
_______________________________________________
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.

References: 
 >Re: C question for you old guys ;-) (From: Brent Gulanowski <email@hidden>)

  • Prev by Date: Scanner bug
  • Next by Date: Re: Which window is good?
  • Previous by thread: Re: C question for you old guys ;-)
  • Next by thread: Re: C question for you old guys ;-)
  • Index(es):
    • Date
    • Thread