I like this proposal!<br><br>+1<br><br>Oldvalue and newvalue have different meanings. I have witnesses programmers overriding oldvalue with the name newvalue and vice versa.<br><br>Of course if you are good at reading the documentation then you would not make the mistake. <br><br>Swift should be a language that prevents a programmer from making mistakes!<br><br>I am in favor of disallowing the name changes. Because it is much more clear if it is an oldvalue or newvalue.<br><br>If a different name is desired there are two solutions, create a new variable or add a capture list.<br><br>set (newValue: TheType) {<br> let temp = newValue<br>}<br><br>set { [temp = newValue] in<br> <br>}<br><br>I think either of these would make this change easier to convert.<br><br>The second one would probably be easier to convert.<br><br>//current<br>set (temp) {<br> <br>}<br><br>// Proposed and much more clear.<br>set { [temp = newValue] in<br> <br>}<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 1, 2016 at 3:01 PM Will Field-Thompson 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 dir="ltr" class="gmail_msg">I'm also against this (though I like the first alternative about warning on <font face="monospace" class="gmail_msg">set(oldValue)</font> etc.).<br class="gmail_msg"><br class="gmail_msg">While I think there may be value in either preventing name overrides or requiring them here, I don't believe it's worth a breaking change. Then again, I have never personally encountered the problem (I tend not to override names), so maybe those who have feel differently. <br class="gmail_msg"><br class="gmail_msg">I also think that if this proposal goes through I would prefer not to allow the current name overriding syntax, even in the self-documenting case. At that point, the self-documenting case seems like unnecessary syntactic noise. It makes sense for a team where observer names are frequently overridden, but when that's disallowed, I feel that the self-documenting case adds very little.<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg">- Will</div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Thu, Dec 1, 2016 at 3:40 AM Tino Heth via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">-1<br class="gmail_msg">
<br class="gmail_msg">
I'm more or less neutral towards the change itself, but combined with the breaking effect, that's a clear "no".<br class="gmail_msg">
<br class="gmail_msg">
None the less, I hope that the whole topic with all its magic words (willSet, didSet, newValue, oldValue…) will be reworked in the future, which would be another argument not to fiddle with it now*<br class="gmail_msg">
<br class="gmail_msg">
- Tino<br class="gmail_msg">
<br class="gmail_msg">
* <a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151214/003148.html" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151214/003148.html</a><br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div></div></div>
_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>