<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 2 Feb 2017, at 13:44, Derrick Ho <<a href="mailto:wh1pch81n@gmail.com" class="">wh1pch81n@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Maybe we can add a new parameter "otherwise" to the forEach method<br class=""><br class="">[1,2,3,4].forEach({<br class=""> // do something<br class="">}<br class="">, otherwise: {<br class=""> // do something if it is an empty array<br class="">})<br class=""></div></blockquote><div><br class=""></div><div>That could be a decent compromise; just tried a simple extension and the following seems to work quite nicely:</div><div><br class=""></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">extension</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Sequence</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> {</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> forEach(</span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> body: (Iterator.Element) </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">throws</span><span style="font-variant-ligatures: no-common-ligatures" class=""> -> </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Void</span><span style="font-variant-ligatures: no-common-ligatures" class="">, otherwise: () </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">throws</span><span style="font-variant-ligatures: no-common-ligatures" class=""> -> </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Void</span><span style="font-variant-ligatures: no-common-ligatures" class="">) </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">rethrows</span><span style="font-variant-ligatures: no-common-ligatures" class=""> -> </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Void</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> it = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.makeIterator()</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> first = it.next() {</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">                        </span></span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> body(first)</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">                        </span></span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">while</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> current = it.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">next</span><span style="font-variant-ligatures: no-common-ligatures" class="">() { </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> body(current) }</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>} </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">else</span><span style="font-variant-ligatures: no-common-ligatures" class=""> { </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> otherwise() }</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> names = [</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"foo"</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"bar"</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"baz"</span><span style="font-variant-ligatures: no-common-ligatures" class="">], empty:[</span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class="">] = []</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">names.forEach({ print($0) }, otherwise: { print(</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"no names"</span><span style="font-variant-ligatures: no-common-ligatures" class="">) })</span></div></div></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">empty.forEach({ print($0) }, otherwise: { print(</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"no names"</span><span style="font-variant-ligatures: no-common-ligatures" class="">) })</span></div></div></div></blockquote><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span></div></div></div><div><br class=""></div><div>Of course it lacks the ability to use continue or break, so the question is; does it add enough utility to add, or is it better left to developers to extend themselves?</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote"><div dir="ltr" class="">On Thu, Feb 2, 2017 at 6:31 AM Haravikk via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""></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"><div class="gmail_msg">I'm of two minds on this feature; I kind of support the idea of the construct, especially because there are some behind the scenes optimisations it can do, and it can look neater.</div><div class="gmail_msg">However, I'm not at all keen on the re-use of else; if there were a better keyword I might suppose that, for example "empty" or something like that, but nothing I can think of feels quite right.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I mean, when it comes down to it the "best" way to write the loop is like:</div><div class="gmail_msg"><br class="gmail_msg"></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="gmail_msg"><div style="font-family:Helvetica;font-size:12px" class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(61,29,129)" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)" class="gmail_msg">var</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg"> it = </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)" class="gmail_msg">names</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">makeIterator</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg">()</span></div></div><div style="font-family:Helvetica;font-size:12px" class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)" class="gmail_msg">if</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)" class="gmail_msg">let</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> first = </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)" class="gmail_msg">it</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)" class="gmail_msg">next</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">() {</span></div></div><div style="font-family:Helvetica;font-size:12px" class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"><span class="m_3702368787638856720Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)" class="gmail_msg">print</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">(first)</span></div></div><div style="font-family:Helvetica;font-size:12px" class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"><span class="m_3702368787638856720Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)" class="gmail_msg">while</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)" class="gmail_msg">let</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> current = </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)" class="gmail_msg">it</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)" class="gmail_msg">next</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">() { </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)" class="gmail_msg">print</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">(current) }</span></div></div></div></blockquote></div><div style="word-wrap:break-word" class="gmail_msg"><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="gmail_msg"><div style="font-family:Helvetica;font-size:12px" class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)" class="gmail_msg"><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg">} </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)" class="gmail_msg">else</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg"> { </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)" class="gmail_msg">print</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">"no names"</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg">) }</span></div></div></div></blockquote></div><div style="word-wrap:break-word" class="gmail_msg"><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="gmail_msg"></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">However this is a horrible thing to do in your own code, especially if the loop body is larger than one line, but is just fine if it's done behind the scenes for you (complete with unwrapping of the iterators if their type is known).</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Which is why I kind of like the idea of having the construct itself; otherwise, like others, I use the less "correct" option like so (for sequences):</div><div class="gmail_msg"><br class="gmail_msg"></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class="gmail_msg"><div class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(61,29,129)" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)" class="gmail_msg">var</span><span style="color:rgb(209,47,27);font-variant-ligatures:no-common-ligatures" class="gmail_msg"> empty = </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)" class="gmail_msg">true</span></div></div><div class="gmail_msg"><div class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)" class="gmail_msg">for</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> name </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)" class="gmail_msg">in</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)" class="gmail_msg">names</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> { </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)" class="gmail_msg">print</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">(name); </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)" class="gmail_msg">empty</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> = </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)" class="gmail_msg">false</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> }</span></div></div><div class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)" class="gmail_msg">if</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)" class="gmail_msg">empty</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg"> { </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)" class="gmail_msg">print</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">"no names"</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg">) }</span></div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">At which point I simply hope that the compiler optimises away the assignment (since it only actually does something on the first pass).</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">So yeah, I can see a use for it, but I'd prefer a construct other than for/else to do it; at the very least a different keyword, as there's the possibility we could also have a while/else as well and it would need to be very clear, which I don't feel that for/else is.</div></div><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 2 Feb 2017, at 11:06, 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_3702368787638856720Apple-interchange-newline gmail_msg"><div class="gmail_msg"><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br class="m_3702368787638856720Apple-interchange-newline gmail_msg">On 1 Feb 2017, at 18:29, Chris Davis 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">ah! I forgot about the break semantics, that’s definitely one for the con list.<br class="gmail_msg"><br class="gmail_msg">I like Nicolas’ solution, clear to read.<br class="gmail_msg"><br class="gmail_msg"><blockquote type="cite" class="gmail_msg">On 1 Feb 2017, at 18:18, Nicolas Fezans <<a href="mailto:nicolas.fezans@gmail.com" class="gmail_msg" target="_blank">nicolas.fezans@gmail.com</a>> wrote:<br class="gmail_msg"><br class="gmail_msg">I tend to write this kind of treatment the other way around...<br class="gmail_msg"><br class="gmail_msg">if names.isEmpty {<br class="gmail_msg"><span class="m_3702368787638856720Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>// do whatever<br class="gmail_msg">} // on other cases I might have a few else-if to treat other cases that need special treament<br class="gmail_msg">else {<br class="gmail_msg"><span class="m_3702368787638856720Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>for name in names {<br class="gmail_msg"><span class="m_3702368787638856720Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span><span class="m_3702368787638856720Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>// do your thing<br class="gmail_msg"><span class="m_3702368787638856720Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>}<br class="gmail_msg">}<br class="gmail_msg"><br class="gmail_msg"></blockquote></blockquote><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">This only works if you know the size of the sequence before you start iterating it. You can, for example, iterate a lazy sequence and calculating its size before iterating it defeats the object.Thus for { … } else { … } where the else block only executes if the for block was never executed does have some utility.</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">However, I am not in favour adding it. The same functionality can be achieved by counting the number of iterations and testing the count afterwards (or by using a boolean). It takes a couple of extra lines of code and an extra variable, but I think that is a Good Thing. It’s more explicit and (as the Python example shows) there could be hidden subtleties that confuse people if for … else … is badly designed. Also, in many cases, I would argue that treating the zero element sequence differently to the n > 0 element sequence is a code smell. About the only use-case I can think of off the top of my head is UI presentation e.g. “your search didn’t return any results” instead of a blank page.</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">Talking of Python, Swift is not Python and the argument not to implement a feature because its semantics conflict with the semantics of a similar looking feature in another language is bogus. I don’t see the Python for … else being different (and having looked it up to see what you all were talking about, my opinion is that the Python for … else is a disaster) as being a legitimate con to this cleaner and more logical idea in Swift.</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><blockquote type="cite" class="gmail_msg"><br class="gmail_msg"></blockquote></blockquote><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">_______________________________________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">swift-evolution mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><a href="mailto:swift-evolution@swift.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class="gmail_msg"></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>
</div></blockquote></div><br class=""></body></html>