Re: Good idea/bad idea?
Re: Good idea/bad idea?
- Subject: Re: Good idea/bad idea?
- From: John McCall <email@hidden>
- Date: Thu, 24 Apr 2014 10:38:31 -0700
On Apr 24, 2014, at 8:48 AM, Scott Ribe <email@hidden> wrote:
> On Apr 24, 2014, at 9:21 AM, Roland King <email@hidden> wrote:
>
>> well not if it's actually
>>
>> x = (x) ?: @"yo";
>
> Actually, that will work just fine. Personally, I'd leave off the extraneous ():
>
> x = x ?: @"yo";
>
> While we're on the subject of obscurities of the ternary operator, if you really want to offend the "verbosity == clarity" crowd, sprinkle your code with some of the these:
>
> (foo ? x : y) = @"yo”;
Note that this is a C++-ism; in C, the result of the ternary operator is always an r-value.
John.
_______________________________________________
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