[swift-evolution] Removing enumerated?
xiaodi.wu at gmail.com
Tue Jan 31 10:36:14 CST 2017
I totally sympathize with users being confused. It's an interesting idea to
move it to Array only.
The thing is, it does make sense (and wouldn't be confusing) to enumerate a
dictionary or set. Moreover, the behavior is _exactly_ what it says on the
tin: when you enumerate something in real life, there is no sense in which
the number is related to some sort of index. Can we fix this by
documentation? Like, a big blaring "don't use this when you want the index"?
On Tue, Jan 31, 2017 at 09:35 Ole Begemann via swift-evolution <
swift-evolution at swift.org> wrote:
> On 31/01/2017 16:19, Ole Begemann via swift-evolution wrote:
> > Here are three previous discussion about this topic:
> > 1) December 2015: [Idea] Add an (Index, Element) sequence to
> > CollectionType
> > and
> > 2) April 2016: [Idea] Replace enumerate() with something more explicit
> > 3) September 2016: [Proposal draft] Introducing `indexed()`
> To clarify, the discussions I linked to don't all propose to remove or
> replace `enumerated()`, but they all talk about the potential confusion
> about what `enumerated()` does and does not do.
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution