<div dir="ltr">If we made class, structs, protocols and functions use the same generics syntax then I think it would make it more consistent rather than arguing about which keyword to use. I am for-ever being tripped up by lack of generics in the language.<div><br></div><div>class Array<T></div><div>{ </div><div>func first() -> T?</div><div>}</div><div><br></div><div>struct Node<Value></div><div>{</div><div>var value: Value</div><div>}</div><div><br></div><div>Array<Int>()</div><div>Node<Int>()<br></div><div><br></div><div>or</div><div><br></div><div>func makeACell<T>() -> T</div><div>{</div><div>}</div><div><br></div><div>makeACell<MyCell>()</div><div><br></div><div>or</div><div><br></div><div>protocol Collection<Item></div><div>{</div><div>func first() -> Item?</div><div>}</div><div><br></div><div>class IntBag : Collection<Int> //We bind protocol "associated type" using generic syntax when subclassing. In this case we are saying Item should be type Int</div><div>{</div><div>}</div><div><br></div><div>class Array<Item>: Collection<Item> //We bind protocol "associated type" using generic syntax when subclassing. In this case we are saying Item should be the same type as the generic type for Array</div><div>{</div><div>}</div><div><br></div><div>IntBag()</div><div>Array<Int>()</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 23, 2015 at 10:58 PM, James Campbell <span dir="ltr"><<a href="mailto:james@supmenow.com" target="_blank">james@supmenow.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">They are placeholders because in the protocol:<div><br></div><div>prtocotol Collection</div><div>{</div><div> placeholder Item</div><div><br></div><div> func first() -> Item?</div><div> {</div><div> }</div><div>}</div><div><br></div><div>Item is a placeholder for a concrete type, at this moment this is a concept "A collection should return an item of a type" but we don't know what that type is as its a plaeholder for a type.</div><div><br></div><div>therefore in:</div><div><br></div><div>class IntCollection: Collection</div><div>{</div><div> placeholder Item = Int</div><div>}</div><div><br></div><div>We are saying that the placeholder should now become a concrete type. In my eyes associated types are nothing more than generics for protocols which in turn could be argued is some kind of placeholder.</div><div><br></div><div>Associated type means nothing to me, associated to what ? A type could be associated to many things like a variable, or a generic or whatever. A placeholder to mean does what it says on the tin. If we moved to protocols using a syntax closer to generics for classes then I think it would be simpilar to grasp for beginners .</div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Wed, Dec 23, 2015 at 9:35 PM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">James or Erica (or someone else), can you explain what makes these types "placeholders"? I don't think of the other requirements in a protocol as "placeholder properties" or "placeholder methods".<br>
<br>
My explanation of these things is "When a particular type X conforms to a protocol, you can ask about the types that X uses to implement the requirements of the protocol". I guess we could call them "related types" instead of "associated types", but that doesn't seem significantly different.<br>
<span><font color="#888888"><br>
Jordan<br>
</font></span><div><div><br>
<br>
> On Dec 23, 2015, at 12:42, James Campbell via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
><br>
> The thing is associated type means nothing to me, it's too technical. Placeholder type I think would be better even if it's only what we called it in the documentation<br>
><br>
> Sent from my iPhone<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="">-- <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>
</span></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>