Re: Nil Coalescing and Optional Chaining?
Re: Nil Coalescing and Optional Chaining?
- Subject: Re: Nil Coalescing and Optional Chaining?
- From: Kyle Sluder <email@hidden>
- Date: Fri, 07 Nov 2014 09:55:43 -0600
On Fri, Nov 7, 2014, at 09:34 AM, David Wood wrote:
>
> > On Nov 7, 2014, at 9:36 AM, Charles Jenkins <email@hidden> wrote:
> >
> > Well, if you have only one argument, then arguments.count would be 1, but to get the argument, you’d ask for Process.arguments[0]. Arrays are zero-based.
>
> D'oh. Well, that fixed it. The final result looks like this:
>
> var inputValue = (Process.arguments.count > 1) ?
> Process.arguments[1].toInt()! : defaultValue
>
> ...and it runs properly in both in Xcode and as a command-line tool.
>
> Only now does it occur to me that the place to post this would have been
> a Swift-dev mailing list. Is that even a thing? There doesn't seem to be
> one of those on lists.apple.com.
There's no mailing list, but there's a very active section of the Dev
Forums, including far more Apple participation than on this list:
<https://devforums.apple.com/community/tools/languages/swift>
--Kyle Sluder
_______________________________________________
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