+1 on all points made by Taras<br><div class="gmail_quote"><div dir="ltr">On Wed, Feb 10, 2016 at 12:44 PM Taras Zakharko via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">It really depends on what you are used to. Swift notation comes from mathematics and formal computer science. You seem to be more used to the Fortran/ALGOL/C syntax. Personally, I prefer the Swift way, its cleaner and less confusing to me. <div><br></div><div>At any rate, I don’t think there is a valid reason to reconsider this design aspect of the language. </div></div><div style="word-wrap:break-word"><div><br><div><br><div><div><div><blockquote type="cite"><div>On 09 Feb 2016, at 23:45, Oliver M via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br><div><div><div style="background-color:rgb(255,255,255);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px"><ul style="list-style-type:none" dir="ltr">
<li style="margin:0px;font-size:12px;font-family:Menlo">A brief observation regarding variable type declarations</li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo">I find the colon in variable type declarations a little odd.</li>
<li style="margin:0px;font-size:12px;font-family:Menlo">Consider the following:</li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo">var welcomeMessage: String</li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo">wouldn't this be cleaner simply written as</li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo">var welcomeMessage String</li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo">the documentation says to read the colon ':' as "of type" in such situations</li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo">but does the type "String" itself not imply 'of type String'</li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo">Consider the colon in a function declaration:</li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo">func sayHello(personName: String) {}</li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo">I would read the portion within the brackets as:</li>
<li style="margin:0px;font-size:12px;font-family:Menlo">parameter named personName takes value of type String (because you input values when calling functions)</li>
<li style="margin:0px;font-size:12px;font-family:Menlo">with the colon reading 'takes value' and "String" again reading 'of type String'</li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo">I find the colon ':' strongly associated with function input values, and with associations [key:value pairs etc]</li>
<li style="margin:0px;font-size:12px;font-family:Menlo">but variables…you don't input anything and they are not inherently associations.</li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo">When coding half asleep I find myself compelled to input a value wherever I see a ':' and I can see myself typing something really really silly</li>
<li style="margin:0px;font-size:12px;font-family:Menlo;min-height:14px"><br></li>
<li style="margin:0px;font-size:12px;font-family:Menlo">var myIndex: "Int" </li>
<li style="margin:0px;font-size:12px;font-family:Menlo">myIndex = 0</li></ul></div></div>_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" 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></div>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">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>
</blockquote></div>