[swift-evolution] [Idea] Replace enumerate() with something more explicit

Charles Srstka cocoadev at charlessoft.com
Fri Apr 15 20:12:24 CDT 2016


> On Apr 15, 2016, at 8:09 PM, Andrew Bennett via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I'm in support of a method of getting a sequence of (Index,Value) pairs (as you know from the other thread). I think I'm leaning toward option three if it's equivalent to `zip(self.indices, self)`, ideally as a concise property like keys/values on a Dictionary.
> 
> I've been using zip in production. I presumed enumerate was intended for enumerating indices, and that it had just been forgotten when the slice changes went through. I'm in favour of removing it.

Instead of removing it, how about just fixing it so that it returns the proper indexes rather than arbitrary numbers?

Charles

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160415/641a5bf9/attachment.html>


More information about the swift-evolution mailing list