<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">I think this type might become more useful if we find a good name for it and better document it. For example, it is a natural fit for parameter list of Chris’ callable type proposal.</div><div class=""><br class=""></div>Since this type accepts duplicate “keys” and does not provide key-based lookup, the first thing that deserves a rename is “Key” generic parameter. I recommend naming it “Label”. <div class=""><br class=""></div><div class="">This type represents how a dictionary literal <i class="">looks</i>, not what it <i class="">means</i>. When we consider the look of it, a dictionary literal is an array literal where each element is labeled. </div><div class=""><br class=""></div><div class="">I can’t think of a really good name, but we may be able to find a more accurate and less confusing name.</div><div class=""><br class=""></div><div class="">Some of the more accurate names are:</div><div class=""><br class=""></div><div class="">LabeledElementCollection</div><div class="">LabeledValueCollection</div><div class="">LabeledValueList</div><div class="">LabeledList</div><div class=""><br class=""></div><div class="">By the way, why this type does not conform to any of the collection protocols while duplicating a lot of collection APIs?<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 8, 2018, at 4:29 PM, Ben Cohen via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">There exists in the standard library a type `DictionaryLiteral` that deserves naming re-consideration before we declare ABI Stability, because it’s confusingly misnamed, being neither a Dictionary (it doesn’t provide key-based lookup of values) nor a Literal. <br class=""><br class="">Instead, it’s just an immutable collection of key-value pairs you can create _from_ a literal.<br class=""><br class="">I’m canvassing for opinions on what it ought to be called. Some suggestions so far:<br class=""><br class=""> - `AssociationCollection`: Following the term of art from some other languages. Slightly obscure-sounding to developers not already familiar. Also “association” and “associative” are confusingly similar, which brings back the is-this-a-dictionary problem.<br class=""> - `KeyValueCollection`: Problematic because key-value comes up in a totally different context in Cocoa.<br class=""> - `PairCollection`: “Pair” is kinda nondescript.<br class=""> - Do nothing. It’s not so bad.<br class=""><br class="">The old name can live on indefinitely via a typealias (which has no ABI consequences, so could be retired at a later date once everyone has had plenty of time to address the deprecation warnings). Removing it as not carrying its weight (and instead using `[(Key,Value)]`, which is basically what it’s a wrapper for) is probably off the table for source stability reasons.<br class=""><br class="">Any further thoughts welcome.<br class=""><br class=""><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="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></div></blockquote></div><br class=""></div></body></html>