<div dir="ltr">If part of this proposal is to update documentation to refer to it as "placeholder" typed then I am okay with "type"</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 23, 2015 at 1:15 PM, Craig Cruden <span dir="ltr"><<a href="mailto:ccruden@novafore.com" target="_blank">ccruden@novafore.com</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">I prefer “type”.<div><div class="h5"><div><br></div><div><br><div><blockquote type="cite"><div>On 2015-12-23, at 20:05:46, Pierre Monod-Broca via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br><div><div style="word-wrap:break-word"><div>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><br></div><div>eg</div><div>class Foo: Stream {</div><div> placeholder Payload = String // IMO doesn't feel right</div><div> type Payload = String // IMO feels good</div><div>}</div><div><br></div><div><div>
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div>-- </div><div>Pierre</div></div>
</div>
<br><div><blockquote type="cite"><div>Le 23 déc. 2015 à 13:59, James Campbell <<a href="mailto:james@supmenow.com" target="_blank">james@supmenow.com</a>> a écrit :</div><br><div><div dir="ltr">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><div class="gmail_quote">On Wed, Dec 23, 2015 at 12:50 PM, Pierre Monod-Broca 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">+1 for `type`, it is consistent with `func`, `var` and `init`. It looks good to me.<div><br></div><div>eg:</div><div><br><div>protocol Stream {</div><div> type Payload</div><div> var ready: Bool { get }</div><div> func read() -> Payload?</div><div>}</div><div><br></div><div>protocol Collection {</div><div> type Element</div><div> var count: Int { get }</div><div> func contains(element: Element) -> Bool</div><div>}</div><div><br></div><div><br><div>
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div>-- </div><div>Pierre</div></div>
</div><div><div>
<br><div><blockquote type="cite"><div>Le 19 déc. 2015 à 18:46, Loïc Lecrenier via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> a écrit :</div><br><div><div>Hi,<br><br>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">https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md</a><br><br>So far, everybody agreed that using distinct keywords for type alias and associated type declarations is a good idea.<br>However, some people think that “associated” is not an ideal replacement because it is too vague.<br>I would like to choose a better keyword before the review, but I’m struggling to find a good replacement. <br><br>So, here are some keywords that were proposed by the community.<br><br>1. associated_type<br>This is the original proposed keyword. It is extremely clear, but snake_cases are un-Swifty.<br><br>2. associatedtype (or typeassociation)<br>This was the first alternative to associated_type. Its purpose is still extremely clear.<br>I like it a lot, but it is a bit long and difficult to read.<br><br>3. associated<br>This is the keyword I chose for the proposal because it was the most well-received initially. <br>It is quite short, very different from “typealias", and sounds good. However, it is also vaguer.<br>Because the word “type” is not in it, it’s unclear what should follow it, and it’s unclear what it declares.<br>For example, one could think that it is an associated *value* and write <br>protocol FixedSizeCollectionProtocol {<br><span style="white-space:pre-wrap">        </span>associated size : Int<br>}<br>Although honestly I doubt many people would write that. <br><br>4. withtype (or needstype)<br>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>But it doesn’t sound very good, and is still vaguer than “associatedtype”.<br><br>5. type<br>This keyword was proposed by several people, but I strongly dislike it.<br>It conflicts with an other proposal about unifying the “static” and “class” keywords for type-level members.<br>I think the fact that it was proposed for two completely different purposes shows that it is too abstract.<br>It would make searching for help more difficult because of its bad googleability.<br><br><br>Personally, I would like to either keep “associated”, or use “associatedtype” because they are the most obvious choices.<br><br>1) Do you agree about using “associatedtype”?<br>2) If not, which keyword would you prefer to use? why? (you can introduce a new one)<br>Bonus) Maybe some twitter-famous person could make a quick poll and see which one developers prefer? 😁 (after they read this email)<br>I would gladly do it myself, but I don’t think my twenty (mostly fake) followers will give me a lot of information. <br><br>Loïc<br><br>_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></div></blockquote></div><br></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">
</div>
<br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><span style="font-size:16px;line-height:19.2px"></span><span style="font-size:12.8px"> Wizard</span><br></div><div><a href="mailto:james@supmenow.com" target="_blank">james@supmenow.com</a></div><div><a href="tel:%2B44%207523%20279%20698" value="+447523279698" target="_blank">+44 7523 279 698</a></div></div></div></div></div></div>
</div>
</div></blockquote></div><br></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="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">
</div>
_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><span style="font-size:16px;line-height:19.2px"></span><span style="font-size:12.8px"> Wizard</span><br></div><div><a href="mailto:james@supmenow.com" target="_blank">james@supmenow.com</a></div><div>+44 7523 279 698</div></div></div></div></div></div>
</div>