<div dir="ltr">Hey everyone,<div><br></div><div>I&#39;ve organized a number of Swift workshops over the last two years. There are a couple of things that keep coming up, and a couple of mistakes that I see people making over and over again. One of them is that in almost every workshop, there&#39;s someone who thinks that `enumerated()` returns a list of (index, element) pairs. This is only true for arrays. It breaks when using array slices, or any other kind of collection. In our workshops, I sometimes see people doing something like `x.reversed().enumerated()`, where `x` is an array, and somehow it produces behavior they don&#39;t understand.</div><div><br></div><div>A few ways I think this could be improved:</div><div><br></div><div>- Move enumerated to Array</div><div>- Change enumerated to return `(Index, Iterator.Element)` (this would mean we at least need to move it to collection)</div><div>- Remove enumerated</div><div>- Keep things as is</div><div><br></div><div>In any case, just wanted to share my experience (gained from teaching people). </div><div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Chris Eidhof</div>
</div></div>