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