Re: C question for you old guys ;-)
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.