<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 26, 2016, at 6:02 AM, Matthew Johnson <<a href="mailto:matthew@anandabits.com" class="">matthew@anandabits.com</a>> wrote:</div><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""><br class=""></div><div class="">I really like the enhancement. This makes a lot of sense. All members are visible, but some members can't be called because you can't form an argument of the necessary type (i.e. when it is a non-concrete associated type and you can't get a value as output of another member of the existential). Thanks for chiming in on this Joe!</div><div class=""><br class=""></div><div class="">There is one part of the update that could use clarification:</div><div class=""><pre style="box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><font face="UICTFontTextStyleTallBody" class=""><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);" class=""><span class="pl-c" style="box-sizing: border-box;">// Okay, because String conforms to both Protocol1 and Streamable</span> </span></font></pre><pre style="box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><font face="UICTFontTextStyleTallBody" class=""><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);" class=""><span class="pl-k" style="box-sizing: border-box;">let</span><span class="Apple-converted-space"> </span>r2<span class="Apple-converted-space"> </span><span class="pl-k" style="box-sizing: border-box;">=</span><span class="Apple-converted-space"> </span>result<span class="Apple-converted-space"> </span><span class="pl-k" style="box-sizing: border-box;">as?</span><span class="Apple-converted-space"> </span><span class="pl-c1" style="box-sizing: border-box;">String</span></span></font></pre></div><div class="">I think you mean that the attempted cast is ok because there is a possibility it might succeed, but it might also fail. The possibility of failure should probably be highlighted.</div></div></div></blockquote><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""><br class=""></div><div class="">You might also want to elaborate that the Int attempt is a compiler error because there is no possibility for the attempted cast to succeed (if that is what you intend).</div></div></div></blockquote><div><br class=""></div><div>Yes, this is exactly what I meant. I'll make the copy clearer. Thanks!</div><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Best,</div><div class="">Austin</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, May 24, 2016 at 5:09 AM, Matthew Johnson via swift-evolution<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><br class=""><br class="">Sent from my iPad<br class=""><span class=""><br class="">On May 23, 2016, at 9:52 PM, Brent Royal-Gordon via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class="">>> One initial bit of feedback - I believe if you have existential types, I believe you can define Sequence Element directly, rather than with a type alias. e.g.<br class="">>><br class="">>> protocol Sequence {<br class="">>> associatedtype Element<br class="">>> associatedtype Iterator: any<IteratorProtocol where IteratorProtocol.Element==Element><br class="">>> associatedtype SubSequence: any<Sequence where Sequence.Element == Element><br class="">>> …<br class="">>> }<br class="">><br class="">> That's not really the same thing. Any<IteratorProtocol> is an existential, not a protocol. It's basically an automatically-generated version of our current `AnyIterator<T>` type (though with some additional flexibility). It can't appear on the right side of a `:`, any more than AnyIterator could.<br class=""><br class=""></span>After this proposal you should be able to use these existentials anywhere you can place a constraint, so it would work. You can do this with the protocol composition operator today and the future existential is just an extension of that capability.<br class=""><span class="im HOEnZb"><br class="">><br class="">> What *would* work is allowing `where` clauses on associated types:<br class="">><br class="">>> protocol Sequence {<br class="">>> associatedtype Element<br class="">>> associatedtype Iterator: IteratorProtocol where Iterator.Element==Element<br class="">>> associatedtype SubSequence: Sequence where SubSequence.Element == Element<br class="">>> …<br class="">>> }<br class="">><br class="">> I believe this is part of the generics manifesto.<br class="">><br class="">> --<br class="">> Brent Royal-Gordon<br class="">> Architechies<br class="">><br class=""></span><div class="HOEnZb"><div class="h5">> _______________________________________________<br class="">> swift-evolution mailing list<br class="">><span class="Apple-converted-space"> </span><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">><span class="Apple-converted-space"> </span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></div></blockquote></div></div></div></blockquote></div></div></blockquote></div><br class=""></body></html>