<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>If ":" should be replaced by "=" than only at the call site to make it more consistent with variable declaration and initialization:</div><div><br></div><div> myFunc(number = 4, string = 7)</div><div><br></div><div> func <span style="background-color: rgba(255, 255, 255, 0);">myFunc(number: Int, string: String) {}</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div>Although writing "=" instead of ":" in methods in 1.5 years Swift and over 20 years Objective-C would be a huge change.</div><div><br></div><div>- Maximilian</div><div><br>Am 06.02.2016 um 01:36 schrieb Andrew Bennett via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>>:<br><br></div><blockquote type="cite"><div><div dir="ltr">Interesting point, I guess ":" in dictionary literals is to make the syntax unambiguous.<div><br></div><div>This is currently valid swift:</div><div><br></div><div> <font face="monospace, monospace">let x = [a = b]</font></div><div><br></div><div>Its type is: Array<<font face="monospace, monospace">Void></font>. It seems like the syntax is clearer if the delimiter isn't a valid operator.</div><div><br></div><div>Also there's a problem with default value syntax:</div><div><br></div><div> <font face="monospace, monospace">func test(a: Int = 123)</font></div><div><br></div><div>This would be hard to read with only "=":</div><div><br></div><div><font face="monospace, monospace"> func test(a = Int = 123)</font><br></div><div><br></div><div>Also if the default value was an operator:</div><div><br></div><div><font face="monospace, monospace"> func test(a = Int -> Int = =)</font></div><div><font face="monospace, monospace"><br></font></div>Granted you could change the less commonly used default syntax, but it's probably syntactically easier to differentiate user-controller delimiters (assignment) and compiler-controller delimiters (:,). The example with assignment in an array illustrates this.<div><br></div><div>I do agree '<span style="font-size:13px"><font face="monospace, monospace">@available</font>'</span> though, it seems like it should be ":"</div><div><br></div><div>=)</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 6, 2016 at 10:27 AM, Brent Royal-Gordon 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">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>
myFunc(foo, bar: baz)<br>
<br>
But it also has:<br>
<br>
@available(iOS, introduced=7.0, deprecated=8.0)<br>
<br>
You create a dictionary like this:<br>
<br>
let dict = ["key": "value"]<br>
<br>
But you set it like this:<br>
<br>
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"><font color="#888888"><br>
--<br>
Brent Royal-Gordon<br>
Architechies<br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">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>
</font></span></blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>