<html><body><div><div>I like the current usage of the colon as it is very readable and unobstrusive.<br></div><div><br></div><div>I agree that @available should use colons, too.<br></div><div><br></div><div>-Thorsten</div><div><br data-mce-bogus="1"></div></div><div><br>Am 07. Februar 2016 um 20:19 schrieb ilya via swift-evolution &lt;swift-evolution@swift.org&gt;:<br><br><div><blockquote type="cite"><div class="msg-quote"><div dir="ltr">I know it's a bit late to the party :) but I have to disagree with the original premise.<div>The colon in the dictionary doesn't really separate names and values, it separates values and values:</div><div><br></div><div>["something" + "else" : 1 + 2]&nbsp;</div><div><br></div><div>is a perfectly valid dictionary that doesn't read nor write anything by name. In other words, there are no lhs-expressions there and that's ok.</div><div><br></div><div>We use = to rebind the names or, more generally, call setters, and when we do this an lhs-expression is required, well, on the left side of an assignment operator. This is in no way related to what happens with the dictionary.&nbsp;</div><div><br></div><div>The situation is different with function parameters. We don't really pass a dictionary; if we did, we'd use something like myFunc("":foo, "bar": baz) as a syntax.&nbsp;</div><div><br></div><div>One can attempt to read the syntax as binding names that the function can use as parameters, but this doesn't really work either: we only know the parameter's external names and this binding doesn't "leak" into the original scope. So if we are thinking about function call as an assignment, then it should be in an extremely short-lived scope contained within a function call. It doesn't look like this view will bring us any benefits.&nbsp;</div><div><br></div><div>I think it's best to imagine the colon in function calls as simply a third punctuation symbol. We do need to select a simple, readily available symbol that cannot be easily mixed with colon-inside-the-dictionary and regular-assignment-symbol, yet is still instantly recognisable. Reusing the colon is a reasonable compromise, although =&gt; would also work (and I wish it was given serious consideration).&nbsp;</div><div><br></div><div>Though I agree that it seems a bit excessive to have a separate syntax for @available's parameters.</div><div><br></div><div>Ilya.</div><div>&nbsp;</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 6, 2016 at 12:27 AM, Brent Royal-Gordon via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" data-mce-href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex; border-left: 1px #ccc solid; padding-left: 1ex;" data-mce-style="margin: 0 0 0 0.8ex; border-left: 1px #ccc solid; padding-left: 1ex;">This is perhaps a bit nitpicky, but I've noticed that Swift sometimes uses colon to separate names and values, and sometimes uses equals. It's vaguely maddening.<br> <br> What do I mean? Well, our language has this:<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; myFunc(foo, bar: baz)<br> <br> But it also has:<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; @available(iOS, introduced=7.0, deprecated=8.0)<br> <br> You create a dictionary like this:<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; let dict = ["key": "value"]<br> <br> But you set it like this:<br> <br> &nbsp; &nbsp; &nbsp; &nbsp; dict["key"] = "value"<br> <br> Is there some principle here? The @available case seems particularly strange to me, because those values read strongly like parameters to me.<br> <span class="HOEnZb"><span style="color: #888888;" data-mce-style="color: #888888;" color="#888888"><br> --<br> Brent Royal-Gordon<br> Architechies<br> <br> _______________________________________________<br> swift-evolution mailing list<br> <a href="mailto:swift-evolution@swift.org" data-mce-href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" data-mce-href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br> </span></span></blockquote></div><br></div><div class="_stretch"><span class="body-text-content">_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" data-mce-href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" data-mce-href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></span></div></div></blockquote></div></div></body></html>