I don't like the idea of for-else since it doesn't really add much value. It hardly saves you any typing.<br><br>-1<br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 6, 2017 at 6:26 PM Erica Sadun 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" class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Feb 6, 2017, at 11:06 AM, Jordan Rose via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br class="m_-6031004944050378748Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div style="word-wrap:break-word" class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Feb 6, 2017, at 02:50, Jeremy Pereira via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br class="m_-6031004944050378748Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><blockquote type="cite" class="gmail_msg">On 3 Feb 2017, at 18:00, Dave Abrahams 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"><br class="gmail_msg"><br class="gmail_msg">on Fri Feb 03 2017, Dimitri Racordon <<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>> wrote:<br class="gmail_msg"><br class="gmail_msg"><blockquote type="cite" class="gmail_msg">Talking of Python, Swift is not Python and the argument not to<br class="gmail_msg">implement a feature because its semantics conflict with the semantics<br class="gmail_msg">of a similar looking feature in another language is bogus. <br class="gmail_msg"></blockquote><br class="gmail_msg">I don't have a anything to say about for-else, but just a comment on the<br class="gmail_msg">meta-point of how we evaluate designs: precedent set by other languages<br class="gmail_msg">affects learnability, and is one of the criteria we've always considered<br class="gmail_msg">when designing Swift.<br class="gmail_msg"><br class="gmail_msg"></blockquote><br class="gmail_msg">Two things:<br class="gmail_msg"><br class="gmail_msg">1. Somehow the quoting in your email has got messed up so it looks like a statement I made was made by somebody else who may or may not agree with the sentiment expressed.<br class="gmail_msg"><br class="gmail_msg">2. You’ve never been shy of going against precedent if you consider it to be a *bad* precedent. Otherwise Swift would still have C style for loops and pre/post increment/decrement operators. That is as it should be. The Python for … else statement is a mess. My brief survey of the Internet suggests it is confusing even to some Python programmers. It should not be allowed to prevent the Swift team from implementing similarly named but better designed features if there are other good reasons for doing so.</div></div></blockquote><br class="gmail_msg"></div><div class="gmail_msg">This is not at odds with what you’re saying, but I wanted to add that there’s a difference between <i class="gmail_msg">removing</i> syntax and having <i class="gmail_msg">conflicting</i> syntax. That is, not having a for-else loop is fine, but having a for-else loop that behaves differently than Python’s would require a pretty strong reason. As far as I know there’s only one place where we deliberately chose to conflict with another language’s precedent, and that’s '…' being an inclusive range (where it is the exclusive range operator in Ruby), and that discussion led to us picking '..<‘ instead of ‘..’ for the other operator.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Jordan</div></div></div></blockquote></div><br class="gmail_msg"></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">And despite disliking the updated .../..< operators at first, I find it has increased </div><div class="gmail_msg">inspectability and clarity at the point of use. Good call in my opinion. </div><div class="gmail_msg">Similar behaviors and outcomes should adopt conventional syntax unless </div><div class="gmail_msg">an updated syntax offers measurable benefits.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">-- E</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Mildly interesting reference: </div><div class="gmail_msg"><a href="https://mail.python.org/pipermail/python-ideas/2009-October/006155.html" class="gmail_msg" target="_blank">https://mail.python.org/pipermail/python-ideas/2009-October/006155.html</a></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></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>