Re: When can String.enumerateSubstringsInRange ever pass in NIL?

2016-06-02 Thread Daryle Walker
But with your way, the method can't be reasonably unit-tested since a NIL may come up randomly. That seems pointless since you can synthesize the string from the other parameters anyway. Sent from my iPhone > On May 30, 2016, at 5:42 AM, Quincey Morris > wrote: > >> On May 29, 2016, at 22:3

Re: When can String.enumerateSubstringsInRange ever pass in NIL?

2016-05-30 Thread Quincey Morris
On May 29, 2016, at 22:31 , Ken Thomases wrote: > > I think the documentation for SubstringNotRequired is sufficient design > contract: > > "NSStringEnumerationSubstringNotRequired > "A way to indicate that the block does not need substring, in which case nil > will be passed. This is simply a

Re: When can String.enumerateSubstringsInRange ever pass in NIL?

2016-05-29 Thread Ken Thomases
On May 29, 2016, at 9:54 PM, Quincey Morris wrote: > > On May 29, 2016, at 19:16 , Daryle Walker > wrote: >> >> Since I am using the substring and not including “.SubstringNotRequired”, I >> can just remove the “guard” block, tack on a “!” to substring’s identifier, >

Re: When can String.enumerateSubstringsInRange ever pass in NIL?

2016-05-29 Thread Quincey Morris
On May 29, 2016, at 19:16 , Daryle Walker wrote: > > Since I am using the substring and not including “.SubstringNotRequired”, I > can just remove the “guard” block, tack on a “!” to substring’s identifier, > and be done with it, right? The problem is there’s no API contract that says exactly

Re: When can String.enumerateSubstringsInRange ever pass in NIL?

2016-05-29 Thread Daryle Walker
Since I am using the substring and not including “.SubstringNotRequired”, I can just remove the “guard” block, tack on a “!” to substring’s identifier, and be done with it, right? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com > On May 29, 2016, at 12:08 AM, Ken T

Re: When can String.enumerateSubstringsInRange ever pass in NIL?

2016-05-28 Thread Ken Thomases
On May 28, 2016, at 8:27 PM, Daryle Walker wrote: > > The last argument to the method is a closure with four parameters. The first > argument is an optional String. I can't think of a circumstance where it'll > be NIL. (I need to know for testing.) Especially since it can be recreated in > ter

When can String.enumerateSubstringsInRange ever pass in NIL?

2016-05-28 Thread Daryle Walker
The last argument to the method is a closure with four parameters. The first argument is an optional String. I can't think of a circumstance where it'll be NIL. (I need to know for testing.) Especially since it can be recreated in terms of the callback's second argument, which isn't optional. (S