<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="">I definitely agree with your concern about angle brackets being used outside a generic context. However, I think I'd prefer the core team syntax (unadorned "P1 & P2") if delimiters are out of the question for now.<div class=""><br class=""></div><div class="">One option might be to use parentheses: Any(X & Y & Z), or square brackets: Any[X & Y & Z]. The former might look too much like a function call, although if we're going to call '&' a type infix operator we might as well stretch the analogy as far as it'll go. I actually like the second approach: you can't define static subscripts (and you wouldn't be able to define them on `Any` even if you could), so it wouldn't occupy an already-extant syntactic slot. Either would give existential types their own characteristic syntax, avoiding the angle brackets issue you brought up.<br class=""><div class=""><br class=""></div><div class="">Austin<br class=""><div class=""><div class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 1, 2016, at 11:39 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">On Thu, Jun 2, 2016 at 12:42 AM, Austin Zheng via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""><div class="gmail_extra"><div class="gmail_quote"><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"><div style="word-wrap:break-word" class="">Excellent.<div class=""><br class=""></div><div class="">I put together a PR with a revised proposal containing the core team's recommended approach. If anyone is curious they can see it here: <a href="https://github.com/austinzheng/swift-evolution/blob/ef6adbe0fe09bff6c44c6aa9d73ee407629235ce/proposals/0095-any-as-existential.md" target="_blank" class="">https://github.com/austinzheng/swift-evolution/blob/ef6adbe0fe09bff6c44c6aa9d73ee407629235ce/proposals/0095-any-as-existential.md</a></div><div class=""><br class=""></div><div class="">Since this is the de-facto second round discussion thread, I'll start with my personal opinion (which is *not* reflected in the PR): the '&' separators in lieu of commas are a good idea, but I would still prefer the types to be wrapped in "Any<>", at least when being used as existentials.</div><div class=""><br class=""></div><div class="">My reasons:</div><div class=""><br class=""></div><div class="">- Jordan Rose brought up a good point in one of the discussion threads today: a resilience goal is to allow a library to add an associated type to a protocol that had none and not have it break user code. If this is true whatever syntax is used for existentials in Swift 3 should be a valid subset of the generalized existential syntax used to describe protocol compositions with no associated types.</div><div class=""><br class=""></div><div class="">- I would rather have "Any<>" be used consistently across all existential types eventually than have it only be used for (e.g.) existential types with `where` constraints, or allowing two different representations of the same existential type (one with Any, and one without).</div><div class=""><br class=""></div><div class="">- I think any generalized existential syntax without delimiting markers (like angle braces) is harder to read than syntax with such markers, so I would prefer a design with those markers.</div></div></blockquote><div class=""><br class=""></div><div class="">Agree with your reasons, but I'm still uncomfortable that things inside the angle brackets would behave differently here than elsewhere. Would it help to make a keyword out of `any` for existentials? Then you could have this:</div><div class=""><br class=""></div><div class="">```</div><div class=""><div style="font-size:13px" class="">func foo(value: any X & Y)</div></div><div class="">```</div><div class=""><br class=""></div><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"><div style="word-wrap:break-word" class=""><div class="">Best,</div><div class="">Austin</div><span class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 1, 2016, at 10:17 PM, Chris Lattner <<a href="mailto:clattner@apple.com" target="_blank" class="">clattner@apple.com</a>> wrote:</div><br class=""><div class=""><div class=""><br class=""><blockquote type="cite" class="">On Jun 1, 2016, at 9:53 PM, Austin Zheng <<a href="mailto:austinzheng@gmail.com" target="_blank" class="">austinzheng@gmail.com</a>> wrote:<br class=""><br class="">This was indeed a very thorough review by the core team. I'll prepare a v2 proposal with this feedback taken into account so we can continue moving things along.<br class=""><br class="">One quick question - is making whatever syntax is chosen for Swift 3 "forward-compatible" with a future generalized existential feature a concern?<br class=""></blockquote><br class="">Yes it is a concern, but we assume that the “X & Y” syntax will always be accepted going forward, as sugar for the more general feature that is yet to be designed.<br class=""><br class="">-Chris</div></div></blockquote></div><br class=""></div></span></div><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><br class="">
<br class=""></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></div></div></div></div></div></body></html>