<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 7, 2015 at 12:43 PM, Maxim Moiseev via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi all,</div><div><br></div><div>Here is the proposal to add more constraints to AnySequence.init in order to implement delegation of method calls to the underlying SequnceType implementation.</div><div><a href="https://github.com/moiseev/swift-evolution/blob/restricted-anyseq/proposals/0008-constrained-AnySequence.md" target="_blank">https://github.com/moiseev/swift-evolution/blob/restricted-anyseq/proposals/0008-constrained-AnySequence.md</a></div><div><br></div><div>(Including full text of the proposal at the bottom for your convenience).</div><div><br></div><div>Final goal would be to eventually properly delegate all the calls to `SequenceType` and `CollectionType` methods inside `AnySequence` and `Any${Traversal}Collection`.</div></div></blockquote><div><br></div><div>Thanks, Max!</div><div><br></div><div>I reviewed this proposal with Max offline and it LGTM. The biggest question that we have to answer is if this change is small enough to be included in Swift 2.2. I would say yes, since the only collections that are affected by this change are collections that we don't consider valid, where the author went an extra mile to declare an improper SubSequence type -- and they would stop working anyway once we can constrain the SubSequence the way we want.</div><div><br></div><div>What does everyone think?</div><div><br></div><div>Dmitri</div></div><div><br></div>-- <br><div>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" target="_blank">gribozavr@gmail.com</a>>*/</div>
</div></div>