Re: [swift-evolution] [Idea] Add AssociativeCollectionType to represent Dictionary-type relationships (was: Add an (Index, Element) sequence to CollectionType)

2015-12-31 Thread Dave Abrahams via swift-evolution
> On Dec 29, 2015, at 2:37 PM, David Waite via swift-evolution > wrote: > > >> Anyway, it would not be correct to ".enumerate()" returns (Index, Element) >> instead of (n, Element)? >> >> I believe that the current behavior was thought when Slices had indices >>

Re: [swift-evolution] [Idea] Add AssociativeCollectionType to represent Dictionary-type relationships (was: Add an (Index, Element) sequence to CollectionType)

2015-12-31 Thread David Waite via swift-evolution
> On Dec 31, 2015, at 9:53 AM, Dave Abrahams wrote: > > What is the use-case for this protocol? I actually suspect you have a better grasp of the pros and cons based on your prior experience, but here goes: An AssociativeCollectionType would allow for alternate

Re: [swift-evolution] [Idea] Add AssociativeCollectionType to represent Dictionary-type relationships (was: Add an (Index, Element) sequence to CollectionType)

2015-12-31 Thread Dmitri Gribenko via swift-evolution
On Thu, Dec 31, 2015 at 9:17 PM, David Waite via swift-evolution < swift-evolution@swift.org> wrote: > > - Array has additional mutating methods which are not described by > CollectionType or any other protocol. The ease of getting a new copy of an > array and mutating it means code needing the

Re: [swift-evolution] [Idea] Add AssociativeCollectionType to represent Dictionary-type relationships (was: Add an (Index, Element) sequence to CollectionType)

2015-12-31 Thread Dave Abrahams via swift-evolution
> On Dec 31, 2015, at 6:09 PM, David Waite wrote: > > Interesting! I never saw any collections outside of the String views > implement that, probably because the swift standard library docs don’t > publish underscore-prefixed protocols. The Array types all

Re: [swift-evolution] [Idea] Add AssociativeCollectionType to represent Dictionary-type relationships (was: Add an (Index, Element) sequence to CollectionType)

2015-12-31 Thread David Waite via swift-evolution
First, let me say that basic premise was intended to be “I would like the ability to have a protocol for dictionary-type objects rather than have it be a single implementation for several reasons, but I expect that there would also be several hurdles to doing so”. It is more of an idea than a