<div dir="ltr">Ah. Thanks. I've read through that proposal before but totally forgot that change.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 1, 2016 at 10:01 PM, Dmitri Gribenko <span dir="ltr"><<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Mar 1, 2016 at 6:55 PM, Trent Nadeau <<a href="mailto:tanadeau@gmail.com">tanadeau@gmail.com</a>> wrote:<br>
> Why is the protocol for iterators called IteratorProtocol instead of<br>
> Iterator or Iterable? If that is/was discussed elsewhere, I apologize, but I<br>
> don't remember seeing that particular name before. Is that new to this<br>
> proposal?<br>
<br>
</span>I'm using the new names introduced by SE-0006<br>
<a href="https://github.com/apple/swift-evolution/blob/master/proposals/0006-apply-api-guidelines-to-the-standard-library.md" rel="noreferrer" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0006-apply-api-guidelines-to-the-standard-library.md</a><br>
<br>
The protocol is not called Iterator to disambiguate it with the<br>
Iterator associated type in Sequence from the protocol:<br>
<br>
protocol Sequence {<br>
associatedtype Iterator : IteratorProtocol<br>
}<br>
<br>
It is not called Iterable because that would have the wrong meaning<br>
(Sequence is iterable, the iterator iterates over its elements).<br>
<span class="HOEnZb"><font color="#888888"><br>
Dmitri<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
--<br>
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br>
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>>*/<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Trent Nadeau</div>
</div>