<div><div><div>Thanks, I just got the point:</div><div> This is a war between Smalltalk and the world.</div><div><br></div><div>In Smalltalk, function is not a type:</div><div> function's signature include attributes name, but Type not,.</div><div>The method Smalltalk treat function, is opposite to the normal method human see the world.</div><div>For exam:</div><div> We just need known someone called Boris Wang, not Boris Wang(attr1,attr2,....,attr100)</div><div><br></div><div>So, the more features we borrowed from the other languages in the world, the more conflicts triggered.</div><div>The more consistent we wanted from Swift, the more conflicts triggered.</div><div><br><div class="gmail_quote"><div>Erica Sadun via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>>于2017年5月9日 周二02:42写道:<br></div></div></div></div></div><div><div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On May 4, 2017, at 8:14 PM, Robert Widmann via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br class="m_3019550614259561404m_1885601899751136287m_6082749200992178755Apple-interchange-newline"><div><div style="word-wrap:break-word">Hi all,<div><br></div><div>So sorry that this proposal comes so late in the game, but I feel it’s too important not to bring it to the attention of the community now. Attached is a proposal to deprecate a language feature many of you will probably have never had the chance to use: Tuple Shuffles. I’ve attached a copy of the first draft of the proposal below, but the latest copy can be read on <a href="https://github.com/apple/swift-evolution/pull/705/files" target="_blank">Github</a>.</div><div><br></div><div>Thanks!</div><div><br></div><div>~Robert Widmann</div><div><br></div></div></div></blockquote></div><br></div><div style="word-wrap:break-word"><div>I'm coming into this ridiculously late. Apologies, but I've had family responsibilities. I've tried to read through the thread before replaying. I hope I have not missed any significant points.</div><div><br></div><div>First, I dislike calling this "tuple shuffles". That phrase has an existing and useful meaning in the Swift community. It refers to what this proposal calls "re-assignment through a tuple pattern". This is what I want to keep calling a "tuple shuffle":</div><div><br></div><div>`(a, b, c) = (b, c, a)`</div><div><br></div><div>I'd rather call the problem space for this proposal "label-led tuple assignment" (or something like that) and reserve "tuple shuffle" for reordered value reassignment.</div><div><br></div><div>Second, I agree with TJ. I dislike that this pattern is legal:</div><div><br></div><div><div>```</div><div>// Declare using labels</div><div>let rgba: (r: Int, g: Int, b: Int, a: Int) = (255, 255, 255, 0)</div><div><br></div><div>// Declare using re-ordered labels</div><div>let argb: (a: Int, r: Int, g: Int, b: Int) = rgba // This is the line I have issue with</div><div><br></div><div>print(argb.a) // "0"</div></div><div>```</div><div><br></div><div>I find this usage counter to Swift's philosophy of clarity and simplicity. It is sufficiently obscure that I consider it a non-standard use regardless of Wux's Google search results. </div><div><br></div><div>Consider the example of Joe Groff's SE-0060 (<a href="https://github.com/apple/swift-evolution/blob/master/proposals/0060-defaulted-parameter-order.md" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0060-defaulted-parameter-order.md</a>). I believe it's reasonable to mandate that the order of labels in declarations be ignored, with the types being compiler-checked. I'd envision that the "correct" behavior should act like this instead:</div><div><br></div><div>```</div><div><div><div>// Declare using re-ordered labels</div><div>let argb: (a: Int, r: Int, g: Int, b: Int) = rgba // (Int, Int, Int, Int) assigned to (Int, Int, Int, Int)</div><div><br></div><div>print(argb.a) // "255"</div></div><div>```</div></div><div><br></div><div>This reworking is partially inspired by SE-0111 (<a href="https://github.com/apple/swift-evolution/blob/master/proposals/0111-remove-arg-label-type-significance.md" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0111-remove-arg-label-type-significance.md</a>), ensuring that the tuple argument labels are not considered in typing the new constant. In fact, this entire proposal might be better named "Removing the Ordering Significance of Tuple Argument Labels in Declarations"</div><div><br></div><div>-- E</div><div><br></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></div></div></div>