Thanks for the correction and I agree that removing the argument label would be a good idea.<br><br>On Tuesday, 19 January 2016, Liam Butler-Lawrence &lt;<a href="mailto:liamdunn@me.com">liamdunn@me.com</a>&gt; 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"><span style="font-family:Menlo;font-size:11px;color:rgb(112,61,170)">Set</span><span style="font-family:Menlo;font-size:11px">(</span><span style="color:rgb(209,47,27);font-family:Menlo;font-size:11px">&quot;a&quot;</span><span style="font-family:Menlo;font-size:11px">, </span><span style="color:rgb(209,47,27);font-family:Menlo;font-size:11px">&quot;b&quot;</span><span style="font-family:Menlo;font-size:11px">, </span><span style="color:rgb(209,47,27);font-family:Menlo;font-size:11px">&quot;c</span><font color="#d12f1b" face="Menlo"><span style="font-size:11px">”</span></font><font face="Menlo"><span style="font-size:11px">) </span></font>doesn’t compile. It currently has to be  <span style="font-family:Menlo;font-size:11px;color:rgb(112,61,170)">Set</span><span style="font-family:Menlo;font-size:11px">(arrayLiteral: </span><span style="font-family:Menlo;font-size:11px;color:rgb(209,47,27)">&quot;a&quot;</span><span style="font-family:Menlo;font-size:11px">, </span><span style="font-family:Menlo;font-size:11px;color:rgb(209,47,27)">&quot;b&quot;</span><span style="font-family:Menlo;font-size:11px">, </span><span style="font-family:Menlo;font-size:11px;color:rgb(209,47,27)">&quot;c</span><font color="#d12f1b" face="Menlo"><span style="font-size:11px">”</span></font><font face="Menlo"><span style="font-size:11px">)</span></font>. That said, I’d be satisfied with removing the external parameter name “arrayLiteral”. Not only is it unnecessary, but it’s confusing too: variadic parameters are not the same as an Array.<div><br></div><div>Liam<div><div><br><div><blockquote type="cite"><div>On Jan 18, 2016, at 5:43 PM, Howard Lovatt via swift-evolution &lt;<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-evolution@swift.org&#39;);" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div>Sorry -1 from me. Doesn&#39;t seem worth it. Not much wrong with Set(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;).<br><br>On Tuesday, 19 January 2016, Seth Friedman via swift-evolution &lt;<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-evolution@swift.org&#39;);" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I dig the idea of Sets having a literal syntax, rather than continuing to be the ugly stepchild of CollectionTypes. I&#39;m not sure, though, that this particular literal syntax is very obvious. While the Array and Dictionary syntaxes are similar enough to many other languages in which arrays and maps exist, I might be confused if I saw your proposed syntax in Swift. <div><br></div><div>Not to mention that it&#39;s not the prettiest syntax, but that&#39;s more subjective.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 18, 2016 at 1:24 PM, Michael Henson via swift-evolution <span dir="ltr">&lt;<a>swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Swift currently has literal and type shorthand syntax for native Array and Dictionary types, but not the Set type. It would be useful to have a literal shorthand for Set as well.<br><br>The existing productions for array and dictionary literals and types share brackets as delimiters, differing only in the contents between the brackets. That poses a slight problem for Set because any syntax, to be useful, must also be easily distinguishable from the other types.<br><br>Consider that Arrays and Dictionaries are both naturally indexed collections. Arrays by the integer value of the order of items in the collection, usually implicitly, and Dictionaries by the hashed key associated with each value.<br><br>Arrays, implicit index:<div><br></div><div>let array = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;]</div><div>var array: [String]</div><div>var empty: [String] = []<br><br>Dictionaries, explicit index:</div><div><br></div><div>let dictionary = [&quot;a&quot;: 1, &quot;b&quot;: 5, &quot;c&quot;: 9]</div><div>var dictionary: [String: Int]</div><div>var empty: [String: Int] = [:]<br><br>Sets, by contrast, have no particular order and no &quot;key&quot;. Even though the Set is enumerable and iterable, it isn&#39;t indexed. With that in mind, we can declare that a Set literal or Set type literal should distinguish itself by declaring that it has no index.</div><div><br>The Set literal could be:<br><br></div><div>let set = [ _: &quot;a&quot;, &quot;b&quot;, &quot;c&quot; ]<br>var set = [ _: String ]</div><div>var empty: [ _: String ] = [_:]</div><div><br></div><div>In the grammar:<br><br>set-literal -&gt; [ _ : array-literal-items[opt] ]<br>literal-expression -&gt; array-literal | dictionary-literal | set-literal<br><br>set-type -&gt; [ _ : type ]</div><div>type -&gt; array-type | dictionary-type | set-type | ... etc.<br><br></div><div><br>Examples:<br><br>let x = [ _: &quot;A&quot;, &quot;B&quot;, &quot;C&quot; ]</div><div>let y: [ _: String ] = [ _: ]<br><br><br>Alternatives considered:<br><br><div>Without literals, declaring a Set type is straightforward, easy to recognize, and not much more verbose. There might not be enough of a difference to justify special syntax in the core language.<br><br>Mike</div></div></div>
<br>_______________________________________________<br>
swift-evolution mailing list<br>
<a>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">Seth Friedman<div><i>Software Development Engineer II</i></div><div><i><a href="http://amazon.com" target="_blank">Amazon.com</a></i></div></div></div></div></div>
</div>
</blockquote><br><br>-- <br>  -- Howard.<br><br>
_______________________________________________<br>swift-evolution mailing list<br><a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-evolution@swift.org&#39;);" 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><br><br>-- <br>  -- Howard.<br><br>