Re: [swift-evolution] [Proposal] More lenient subscript methods over Collections (was: [Proposal] Safer half-open range operator)

2016-05-09 Thread Patrick Smith via swift-evolution
I like the idea of the of the bounded subscript, however the optional one I feel could be used for clumsy code. .first and .last have value, but once you start stepping several arbitrary indices in, then that code is likely fragile? I can think of ‘within’, ‘inside’ and ‘intersecting’ as

Re: [swift-evolution] [Proposal] More lenient subscript methods over Collections (was: [Proposal] Safer half-open range operator)

2016-05-09 Thread Brent Royal-Gordon via swift-evolution
> lenient -> keep "lenient:" ? "requested:" ? "optional:"? `checking:`, to indicate that the index will be checked before it's used? -- Brent Royal-Gordon Architechies ___ swift-evolution mailing list swift-evolution@swift.org

Re: [swift-evolution] [Proposal] More lenient subscript methods over Collections (was: [Proposal] Safer half-open range operator)

2016-05-06 Thread Luis Henrique B. Sousa via swift-evolution
Yes @Matthew, I did; my very first draft sought to change the default subscript method. However, there were some opinions against overriding the default *fail fast* behaviour as it could result in more bugs and in an overload to debug. It wasn't set in stone, so I think it's something that could

Re: [swift-evolution] [Proposal] More lenient subscript methods over Collections (was: [Proposal] Safer half-open range operator)

2016-05-06 Thread Matthew Johnson via swift-evolution
Did you consider making the safer, optional overload the "default" and just omit the label? Sent from my iPad > On May 6, 2016, at 10:23 AM, Luis Henrique B. Sousa via swift-evolution > wrote: > > "bounded" sounds good to me, but I don't know if "optional" is a

Re: [swift-evolution] [Proposal] More lenient subscript methods over Collections (was: [Proposal] Safer half-open range operator)

2016-05-06 Thread Luis Henrique B. Sousa via swift-evolution
"bounded" sounds good to me, but I don't know if "optional" is a good choice as it could be highlighted as a reserved keyword: https://github.com/luish/swift-evolution/blob/more-lenient-subscripts/proposals/-more-lenient-collections-subscripts.md#detailed-design - Luis On Fri, Apr 29, 2016

Re: [swift-evolution] [Proposal] More lenient subscript methods over Collections (was: [Proposal] Safer half-open range operator)

2016-04-29 Thread Vladimir.S via swift-evolution
From my point of view, truncate -> bounded lenient -> keep "lenient:" ? "requested:" ? "optional:"? On 29.04.2016 17:46, Thorsten Seitz wrote: Some alternatives to 'safe:' existing: bounded: valid: -Thorsten Am 29.04.2016 um 00:20 schrieb Luis Henrique B. Sousa via swift-evolution

Re: [swift-evolution] [Proposal] More lenient subscript methods over Collections (was: [Proposal] Safer half-open range operator)

2016-04-29 Thread Thorsten Seitz via swift-evolution
Some alternatives to 'safe:' existing: bounded: valid: -Thorsten > Am 29.04.2016 um 00:20 schrieb Luis Henrique B. Sousa via swift-evolution > : > > Thanks Vladimir, your considerations and suggestions are totally valid, I'm > going to change the document

Re: [swift-evolution] [Proposal] More lenient subscript methods over Collections (was: [Proposal] Safer half-open range operator)

2016-04-28 Thread Vladimir.S via swift-evolution
I support this proposal. Probably we all should select the best labels (truncate/lenient or other). As not native English speaker, I don't feel like 'lenient' is well-known word or often-used word in software development. But all this just a details we need to discuss. What I think could be

Re: [swift-evolution] [Proposal] More lenient subscript methods over Collections (was: [Proposal] Safer half-open range operator)

2016-04-28 Thread Luis Henrique B. Sousa via swift-evolution
As we have discussed throughout this thread, the initial proposal was modified to include alternative subscript methods instead of modifying the default operator/subscript behaviour. The first draft is here: