[swift-evolution] index indexes and ranges of String

2017-01-09 Thread Carlos García via swift-evolution
Hi, I think this is important enough and useful for we to be in the core standard library extension String { func index(of string: String, options: String.CompareOptions = .literal) -> String.Index? { return range(of: string, options: options)?.lowerBound } func indexes(of

Re: [swift-evolution] [Proposal draft] Use obtain let instead if let construction

2017-01-07 Thread Carlos García via swift-evolution
s are confused about the optional unwrapping process, even after > reading the many parts of the Swift book that offer examples of its use cases > and semantics, then I would be more concerned. But I'm not inclined to > believe it's enough to warrant a change this large at this

Re: [swift-evolution] [Proposal draft] Use obtain let instead if let construction

2017-01-07 Thread Carlos García via swift-evolution
et` is more confusing, as it's not clear that it's a >> conditional from that keyword. Plus to me, "obtain" seems like it would be >> getting something from somewhere else, not always locally, maybe use an >> `unwrap` keyword in there somewher

Re: [swift-evolution] [Proposal draft] Use obtain let instead if let construction

2017-01-07 Thread Carlos García via swift-evolution
proceed if the item is non-null: >> Guard. >> >> We already have a keyword and behaviour that you specify in the “guard” >> behaviour. >> >> Additionally, changing “guard” to be “obtain” would require “obtain” to be >> signficantly better than the “

Re: [swift-evolution] [Proposal draft] Use obtain let instead if let construction

2017-01-07 Thread Carlos García via swift-evolution
signficantly better than the “guard” wording - instead, it is significantly > worse. > > > >> On 8 Jan 2017, at 1:46 pm, Carlos García via swift-evolution >> mailto:swift-evolution@swift.org>> wrote: >> >> Hi all, >> >> Here’s a draf

Re: [swift-evolution] [Proposal draft] Use obtain let instead if let construction

2017-01-07 Thread Carlos García via swift-evolution
ere, if you want it to be very clear what's > happening? > > -thislooksfun (tlf) > >> On Jan 7, 2017, at 8:46 PM, Carlos García via swift-evolution >> mailto:swift-evolution@swift.org>> wrote: >> >> Hi all, >> >> Here’s a draft p

[swift-evolution] [Proposal draft] Use obtain let instead if let construction

2017-01-07 Thread Carlos García via swift-evolution
Hi all, Here’s a draft proposal to change if let construction for obtain let. Proposal is at: https://github.com/carlosypunto/swift-evolution/blob/obtain-let-instead-if-let/proposals/-Use-obtain-let-instead-if-let-constructions.md