Re: Nil Coalescing and Optional Chaining?

2014-11-07 Thread Kyle Sluder
On Fri, Nov 7, 2014, at 09:34 AM, David Wood wrote: > > > On Nov 7, 2014, at 9:36 AM, Charles Jenkins 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. We

Re: Nil Coalescing and Optional Chaining?

2014-11-07 Thread Scott Ribe
On Nov 7, 2014, at 8:34 AM, David Wood wrote: > > 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? No, use of Swift is so intimately tied to Cocoa that they're having those discussions here. -- Scott Ribe scott_r...@el

Re: Nil Coalescing and Optional Chaining?

2014-11-07 Thread David Wood
> On Nov 7, 2014, at 9:36 AM, Charles Jenkins 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 =

Re: Nil Coalescing and Optional Chaining?

2014-11-07 Thread Charles Jenkins
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. — Charles Jenkins On Friday, November 7, 2014 at 09:30, David Wood wrote: > (Dagnabbed mailing list didn’t set the ReplyTo field! What’

Re: Nil Coalescing and Optional Chaining?

2014-11-07 Thread David Wood
(Dagnabbed mailing list didn’t set the ReplyTo field! What’s up with that?) > On Nov 7, 2014, at 8:57 AM, Charles Jenkins wrote: > > It looks to me like Process.arguments[] does not return an optional value. I > think you need to find out how many elements are in the array before > attempting

Nil Coalescing and Optional Chaining?

2014-11-07 Thread David Wood
I'm just trying to cut my teeth on Swift here, and there are a few command-line activities I like to use to make sure I understand what a language is doing. The goal in this case is to take a parameter from the command line, that may or may not have been entered with the command that started the