<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="">You are right. Someone else overly eagerly linked&nbsp;<a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001110.html" class="">this other thread</a>&nbsp;and brought me into their confusion :)<br class=""><div class="">
<br class="Apple-interchange-newline"><span style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;" class="">Félix</span>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">Le 26 janv. 2016 à 17:30:58, Andrew Bennett &lt;<a href="mailto:cacoyi@gmail.com" class="">cacoyi@gmail.com</a>&gt; a écrit :</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">What you described Felix seems to be different to what was proposed, also I think (as you suggest) that `else` is unclear for what you describe.</div><div class=""><br class=""></div><div class="">To clarify, is what you're suggesting logically equivalent to this?</div><div class=""><br class=""></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="color:rgb(187,44,162)" class="">if</span><span style="color:rgb(34,34,34)" class=""> </span><span style="color:rgb(187,44,162)" class="">let</span><span style="color:rgb(34,34,34)" class=""> found = [</span><span style="color:rgb(39,42,216)" class="">1</span><span style="color:rgb(34,34,34)" class="">,</span><span style="color:rgb(39,42,216)" class="">2</span><span style="color:rgb(34,34,34)" class="">,</span><span style="color:rgb(39,42,216)" class="">3</span><span style="color:rgb(34,34,34)" class="">,</span><span style="color:rgb(39,42,216)" class="">4</span><span style="color:rgb(34,34,34)" class="">].</span><span style="color:rgb(49,89,93)" class="">find(</span><span style="color:rgb(34,34,34)" class="">{ </span><span style="color:rgb(34,34,34)" class="">$0 == </span><span style="color:rgb(39,42,216)" class="">3&nbsp;</span><span style="color:rgb(34,34,34)" class="">}) {</span></div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="" class="">&nbsp; &nbsp; </span><span style="color:rgb(61,29,129)" class="">print</span><span style="" class="">(</span>"exited early (<span style="" class="">\</span>(<span style="" class="">found</span>))"<span style="" class="">)</span></div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(61, 29, 129);" class=""><span style="" class=""><br class=""></span></div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="color:rgb(187,44,162)" class="">extension</span><span style="" class="">&nbsp;</span>SequenceType<span style="" class="">&nbsp;{</span></div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp;&nbsp;<span style="color:rgb(187,44,162)" class="">func</span>&nbsp;find(</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color:rgb(187,44,162)" class="">@noescape</span>&nbsp;each: Generator.Element&nbsp;<span style="color:rgb(187,44,162)" class="">throws</span>&nbsp;-&gt;&nbsp;<span style="color:rgb(112,61,170)" class="">Bool</span></div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="" class="">&nbsp; &nbsp;&nbsp;)&nbsp;</span><span style="color:rgb(187,44,162)" class="">rethrows</span><span style="" class="">&nbsp;-&gt;&nbsp;</span>Generator<span style="" class="">.</span>Element<span style="" class="">? {</span></div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color:rgb(187,44,162)" class="">for</span>&nbsp;element&nbsp;<span style="color:rgb(187,44,162)" class="">in</span>&nbsp;<span style="color:rgb(187,44,162)" class="">self</span>&nbsp;{</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color:rgb(187,44,162)" class="">if</span>&nbsp;<span style="color:rgb(187,44,162)" class="">try</span>&nbsp;each(element) ==&nbsp;<span style="color:rgb(187,44,162)" class="">false</span>&nbsp;{</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color:rgb(187,44,162)" class="">return</span>&nbsp;element</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;}</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;}</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color:rgb(187,44,162)" class="">return</span>&nbsp;<span style="color:rgb(187,44,162)" class="">nil</span></div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp;&nbsp;}</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div></div></blockquote><div class=""><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(112,61,170)" class="">


















</p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div>If that's correct then I prefer the keyword in the other thread `<font face="monospace, monospace" class="">nobreak</font>` although it could be a better.</div><div class=""><br class=""></div><div class=""><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001110.html" rel="noreferrer" target="_blank" style="font-size:13px" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001110.html</a></div><div class=""><br class=""></div><div class="">We'd have to confirm with Lee, but their example (this thread) seems oriented around zero items rather than early exit:</div><div class=""><br class=""></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="color:rgb(187,44,162)" class="">let</span> items: <span style="color:rgb(112,61,170)" class="">Int</span> = []</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="color:rgb(187,44,162)" class="">for</span> item <span style="color:rgb(187,44,162)" class="">in</span> items {</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; print(item)</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class="">else<span style="" class=""> {</span></div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; print(<span style="color:rgb(209,47,27)" class="">"No items"</span>)</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div></div></blockquote><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div>My suggestion works for zero items.<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div></div><div class=""><br class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jan 27, 2016 at 4:47 AM, Félix Cloutier <span dir="ltr" class="">&lt;<a href="mailto:felixcca@yahoo.ca" target="_blank" class="">felixcca@yahoo.ca</a>&gt;</span> wrote:<br class=""><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="">This is more a demonstration that the for...else construct isn't obvious than a solution to the problem. In Python, the else branch of a for loop is executed when you went through all the iterations without breaking ("when the loop condition becomes false", which doesn't happen if you break from the loop).<span class="HOEnZb"><font color="#888888" class=""><br class=""><div class="">
<br class=""><span style="font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: 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="">Félix</span>
</div></font></span><div class=""><div class="h5">

<br class=""><div class=""><blockquote type="cite" class=""><div class="">Le 25 janv. 2016 à 23:14:23, Andrew Bennett via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; a écrit :</div><br class=""><div class=""><div dir="ltr" class="">This may do what you want:<div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="">&nbsp; &nbsp;&nbsp;<span style="color:rgb(187,44,162)" class="">let</span> values: [<span style="color:rgb(112,61,170)" class="">Int</span>] = [<span style="color:rgb(39,42,216)" class="">1</span>,<span style="color:rgb(39,42,216)" class="">2</span>,<span style="color:rgb(39,42,216)" class="">3</span>,<span style="color:rgb(39,42,216)" class="">4</span>]</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="">&nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">if</span> <span style="color:rgb(187,44,162)" class="">let</span> sequence = <span style="color:rgb(49,89,93)" class="">nonEmptySequence</span>(<span style="color:rgb(79,129,135)" class="">values</span>) {</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">for</span> element <span style="color:rgb(187,44,162)" class="">in</span> sequence {</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:rgb(61,29,129)" class="">print</span>(<span style="color:rgb(209,47,27)" class="">"element: </span>\<span style="color:rgb(209,47,27)" class="">(</span>element<span style="color:rgb(209,47,27)" class="">)"</span>)</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="">&nbsp; &nbsp; }</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="">&nbsp; &nbsp; <span style="color:rgb(187,44,162)" class="">else</span> {</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:rgb(61,29,129)" class="">print</span>(<span style="color:rgb(209,47,27)" class="">"empty!"</span>)</div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="">







</p><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="">&nbsp; &nbsp; }</div></div><div class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><br class=""></div>It's also more flexible, you can do work after the for loop (that work won't execute in the else), you can also use PeekSequence directly to get the first value. This is handy for something like an average (reduce) where you don't necessarily have a zero value.</div><div class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><br class=""></div>The implementation can be found here:&nbsp;<a href="https://github.com/therealbnut/PeekSequence" target="_blank" class="">https://github.com/therealbnut/PeekSequence</a></div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Jan 26, 2016 at 12:59 AM, Matthew Johnson via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class=""><div class=""><br class=""><br class="">Sent from my iPad</div><span class=""><div class=""><br class="">On Jan 25, 2016, at 3:41 AM, Howard Lovatt via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div class=""></div><div class="">It would be easy enough to add:</div><div class=""><br class=""></div><ul style="margin:0px;padding:0px;width:auto;list-style:none" class=""><li style="text-indent:0px;border-left-style:none;margin-left:4em;padding-bottom:0px!important" class=""><font face="UICTFontTextStyleTallBody" class=""><span style="background-color:rgba(255,255,255,0)" class=""><code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">func</code>&nbsp;<code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">forEach</code><code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">(</code></span></font></li><li style="text-indent:0px;border-left-style:none;margin-left:4em;padding-bottom:0px!important" class=""><font face="UICTFontTextStyleTallBody" class=""><span style="background-color:rgba(255,255,255,0)" class=""><code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">&nbsp; &nbsp; @</code><code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">noescape</code>&nbsp;elements&nbsp;<code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">body</code><code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">: (</code><code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">Element</code><code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">)&nbsp;</code><code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">throws<font face="UICTFontTextStyleTallBody" class="">&nbsp;-&gt; Void</font></code><code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">,</code></span></font></li><li style="text-indent:0px;border-left-style:none;margin-left:4em;padding-bottom:0px!important" class=""><font face="UICTFontTextStyleTallBody" class=""><span style="background-color:rgba(255,255,255,0)" class=""><code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">&nbsp; &nbsp; @noescape otherwise otherwise: () throws -&gt; Void</code></span></font></li><li style="text-indent:0px;border-left-style:none;margin-left:4em;padding-bottom:0px!important" class=""><font face="UICTFontTextStyleTallBody" class=""><span style="background-color:rgba(255,255,255,0)" class=""><code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">)&nbsp;</code><code style="padding:0px!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important;border-bottom-right-radius:0px!important;border-bottom-left-radius:0px!important;background-image:none!important;border:0px!important;float:none!important;min-height:auto!important;line-height:1.1em!important;margin:0px!important;outline:0px!important;overflow:visible!important;vertical-align:baseline!important;width:auto!important;min-height:inherit!important" class="">rethrows</code></span></font></li></ul><div class=""><font face="monospace" class=""><br class=""></font></div><div class=""><font face="monospace" class="">to the standard library or write it yourself.</font></div></div></blockquote><div class=""><br class=""></div></span><div class="">Not unless / until we get the ability for a noescape closure to influence control flow (break, return, etc).&nbsp; Even then this is clunkier than adding else to the language would be.</div><div class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">On 23 Jan 2016, at 12:59 PM, Félix Cloutier via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class="">I frequently need something like that and I'd like to have it in Swift too.<br class=""><div class="">
<br class=""><span style="font-family:'Lucida Grande';font-size:12px;font-style:normal;font-variant: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="">Félix</span>
</div>

<br class=""><div class=""><blockquote type="cite" class=""><div class="">Le 22 janv. 2016 à 13:22:45, Ben Langmuir via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; a écrit :</div><br class=""><div class=""><div class="">Previous discussion here:<br class=""><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001110.html" target="_blank" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001110.html</a><br class=""><br class=""><br class=""><blockquote type="cite" class="">On Jan 22, 2016, at 8:22 AM, Lee M via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class="">This has likely been discussed already, but I haven't been able to find it anywhere.<br class="">Example:<br class=""><br class=""> &nbsp;&nbsp;&nbsp;let items: Int = []<br class=""><br class=""> &nbsp;&nbsp;&nbsp;for item in items {<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(item)<br class=""> &nbsp;&nbsp;&nbsp;}<br class=""> &nbsp;&nbsp;&nbsp;else {<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print("No items")<br class=""> &nbsp;&nbsp;&nbsp;}<br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></blockquote><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></div></blockquote></div><br class=""></div></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div></div></div><br class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>