<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 prefer “type”.<div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 2015-12-23, at 20:05:46, Pierre Monod-Broca via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I would agree to stop talking about associated types and start talking about placeholder types instead.</div>But as a keyword, IMO the problem is that `placeholder` is not appropriate to define the implementation.<div class=""><br class=""></div><div class="">eg</div><div class="">class Foo: Stream {</div><div class="">&nbsp; &nbsp; placeholder Payload = String // IMO doesn't feel right</div><div class="">&nbsp; &nbsp; type Payload = String // IMO feels good</div><div class="">}</div><div class=""><br class=""></div><div class=""><div class="">
<div style="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; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">--&nbsp;</div><div class="">Pierre</div></div>
</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class="">Le 23 déc. 2015 à 13:59, James Campbell &lt;<a href="mailto:james@supmenow.com" class="">james@supmenow.com</a>&gt; a écrit :</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I think we should use "placeholder" it more accurately describes what it does. For a bigger change then I would propose my protocol generics idea.</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Dec 23, 2015 at 12:50 PM, Pierre Monod-Broca via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">+1 for `type`, it is consistent with `func`, `var` and `init`. It looks good to me.<div class=""><br class=""></div><div class="">eg:</div><div class=""><br class=""><div class="">protocol Stream {</div><div class="">&nbsp; &nbsp; type Payload</div><div class="">&nbsp; &nbsp; var ready: Bool { get }</div><div class="">&nbsp; &nbsp; func read() -&gt; Payload?</div><div class="">}</div><div class=""><br class=""></div><div class="">protocol Collection {</div><div class="">&nbsp; &nbsp; type Element</div><div class="">&nbsp; &nbsp; var count: Int { get }</div><div class="">&nbsp; &nbsp; func contains(element: Element) -&gt; Bool</div><div class="">}</div><div class=""><br class=""></div><div class=""><br class=""><div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div class="">--&nbsp;</div><div class="">Pierre</div></div>
</div><div class=""><div class="h5">
<br class=""><div class=""><blockquote type="cite" class=""><div class="">Le 19 déc. 2015 à 18:46, Loïc Lecrenier via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; a écrit :</div><br class=""><div class=""><div class="">Hi,<br class=""><br class="">I’m starting a new thread for this proposal <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md" target="_blank" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md</a><br class=""><br class="">So far, everybody agreed that using distinct keywords for type alias and associated type declarations is a good idea.<br class="">However, some people think that “associated” is not an ideal replacement because it is too vague.<br class="">I would like to choose a better keyword before the review, but I’m struggling to find a good replacement. <br class=""><br class="">So, here are some keywords that were proposed by the community.<br class=""><br class="">1. associated_type<br class="">This is the original proposed keyword. It is extremely clear, but snake_cases are un-Swifty.<br class=""><br class="">2. associatedtype (or typeassociation)<br class="">This was the first alternative to associated_type. Its purpose is still extremely clear.<br class="">I like it a lot, but it is a bit long and difficult to read.<br class=""><br class="">3. associated<br class="">This is the keyword I chose for the proposal because it was the most well-received initially. <br class="">It is quite short, very different from “typealias", and sounds good. However, it is also vaguer.<br class="">Because the word “type” is not in it, it’s unclear what should follow it, and it’s unclear what it declares.<br class="">For example, one could think that it is an associated *value* and write <br class="">protocol FixedSizeCollectionProtocol {<br class=""><span style="white-space:pre-wrap" class="">        </span>associated size : Int<br class="">}<br class="">Although honestly I doubt many people would write that. <br class=""><br class="">4. withtype (or needstype)<br class="">It is short, somewhat easy to read, has the word “type” in it, and some concept of association thanks to “with”. I like it. <br class="">But it doesn’t sound very good, and is still vaguer than “associatedtype”.<br class=""><br class="">5. type<br class="">This keyword was proposed by several people, but I strongly dislike it.<br class="">It conflicts with an other proposal about unifying the “static” and “class” keywords for type-level members.<br class="">I think the fact that it was proposed for two completely different purposes shows that it is too abstract.<br class="">It would make searching for help more difficult because of its bad googleability.<br class=""><br class=""><br class="">Personally, I would like to either keep “associated”, or use “associatedtype” because they are the most obvious choices.<br class=""><br class="">1) Do you agree about using “associatedtype”?<br class="">2) If not, which keyword would you prefer to use? why? (you can introduce a new one)<br class="">Bonus) Maybe some twitter-famous person could make a quick poll and see which one developers prefer? 😁 (after they read this email)<br class="">I would gladly do it myself, but I don’t think my twenty (mostly fake) followers will give me a lot of information. &nbsp;<br class=""><br class="">Loïc<br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></div></blockquote></div><br class=""></div></div></div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=xV0JY-2FdZMnUMvSFtZnLiBPRTDDOSQf3-2FpH33HYOlBxG3Hp0cjF3y1krrFg8aRX8pexARNDXh1c1O9RGcc7cFYlmoA0RKFET-2FpPswRDbp6Fzf2sbP8IbTbPVzcRVmbBhhJNGjKVT9oJbvqf63WhqbcWN-2FxU9GIRKwtNecN0iHZJhgm7-2FYHdWMUdCg83-2BIfgWTgPscgwtZbpkEB2j-2BmBTxkr4zmdfrYx-2BdYhYgOSaDtqo-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important" class="">
</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=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><span style="font-size:16px;line-height:19.2px" class=""></span><span style="font-size:12.8px" class="">&nbsp;Wizard</span><br class=""></div><div class=""><a href="mailto:james@supmenow.com" target="_blank" class="">james@supmenow.com</a></div><div class="">+44 7523 279 698</div></div></div></div></div></div>
</div>
</div></blockquote></div><br class=""></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=CGU22LnxbYa2EM3wKvzuC6syQDwKa0tMs5IyT5gL1wI1OkegMIFj-2FXoYHDw-2F0TKpxEfvTfHoiiNlDV6FJFo9kkm6g4AtPSE7632Ck9SEgTkxeHeePIH9jwMlFj9GxPZkBS0MZ8bFzpwUOWUsYyPIN4oAkm0kGHyj4-2BVnUx-2FoE6qMZo4YMpXG2dHXAgSUMUNa8V6l9B5Ltb-2B4ADRLLifQG1nAiozyjc7RbpIyQ7U-2FtPQ-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
</div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>