• 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: Good idea/bad idea?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Good idea/bad idea?


  • Subject: Re: Good idea/bad idea?
  • From: Scott Ribe <email@hidden>
  • Date: Thu, 24 Apr 2014 09:48:18 -0600

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";

;-)

--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice





_______________________________________________

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: Good idea/bad idea?
      • From: Scott Ribe <email@hidden>
    • Re: Good idea/bad idea?
      • From: John McCall <email@hidden>
References: 
 >Good idea/bad idea? (From: Alex Zavatone <email@hidden>)
 >Re: Good idea/bad idea? (From: Raheel Ahmad <email@hidden>)
 >Re: Good idea/bad idea? (From: Alex Zavatone <email@hidden>)
 >Re: Good idea/bad idea? (From: Roland King <email@hidden>)

  • Prev by Date: Re: Good idea/bad idea?
  • Next by Date: Re: showing load progress for autosaved documents
  • Previous by thread: Re: Good idea/bad idea?
  • Next by thread: Re: Good idea/bad idea?
  • Index(es):
    • Date
    • Thread