<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="">Even better (shorter)<div class=""><br class=""></div><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">loop</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;{</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp; &nbsp;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0);">// code</span><br class=""><span style="font-family: Menlo; font-size: 11px;" class="">}</span><div class=""><font color="#5856d6" face="Menlo" class=""><span style="font-size: 11px;" class=""><br class=""></span></font><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">loop</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">for</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;x&nbsp;</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">in</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">0</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">..&lt;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">5</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;{</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp; &nbsp;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0);">// code</span><br class=""><span style="font-family: Menlo; font-size: 11px;" class="">}</span></div><div class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""><br class=""></span></font><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">loop</span><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">for</span><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">var</span><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp;i =&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">0</span><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">while</span><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp;someCondition(i) {</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp; &nbsp;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0);">// code</span><br class=""><span style="font-family: Menlo; font-size: 11px;" class="">}</span></div><div class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""><br class=""></span></font><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">loop</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">for</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">var</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;i =&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">0</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;{</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp; &nbsp;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0);">// code</span><br class=""><span class="" style="color: rgb(0, 132, 0); font-family: Menlo; font-size: 11px;">}&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">while</span><span class="" style="color: rgb(0, 132, 0); font-family: Menlo; font-size: 11px;">&nbsp;<span style="color: rgb(0, 0, 0);" class="">someCondition(i)</span>&nbsp;</span><span class="" style="color: rgb(0, 132, 0); font-family: Menlo; font-size: 11px;">// The i variable would likely have to be considered in scope in the while expression</span><br class=""><font color="#00afcd" class=""><br class=""></font><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">loop</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">5</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;{</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp; &nbsp;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0);">// code</span><br class=""><span style="font-family: Menlo; font-size: 11px;" class="">}</span><br class=""><font color="#00afcd" class=""><br class=""></font><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">loop</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">for</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">var</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;i =&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">0</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">while</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;i &lt;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">5</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">&nbsp;{</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp; &nbsp;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0);">// code</span><br class=""><div class=""><div class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class=""><span class="" style="font-family: Menlo; font-size: 11px;">}&nbsp;<span style="color: rgb(187, 44, 162);" class="">always</span>&nbsp;i +=&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">1</span></div></div></div></div></div></div></div><div class=""><blockquote type="cite" class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class=""><blockquote type="cite" class=""></blockquote></div></div></div></div></blockquote></div></div></blockquote></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 9, 2015, at 1:29 PM, Tyler Cloutier via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Sorry, something is up with my email address.&nbsp;</span><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""><div class=""><blockquote type="cite" class=""></blockquote><font color="#5856d6" class=""><br class=""></font>Oooh and one more, the Infinite Loop:<br class=""><font color="#5856d6" class=""><br class=""></font><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">repeat</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span>{</span><br class=""><font color="#5856d6" face="Menlo" class=""><span class="" style="font-size: 11px;"><br class=""></span></font><span class="" style="font-family: Menlo; font-size: 11px;">}</span><br class=""><font color="#5856d6" class=""><br class=""><br class=""></font><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class="">On Dec 9, 2015, at 12:58 PM, Tyler Cloutier via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><blockquote type="cite" class=""></blockquote><font color="#00afcd" class=""><br class=""></font>I’m still of the belief that all types of loops could be condensed down to a single type of loop, the repeat-for loop<br class=""><font color="#00afcd" class=""><br class=""></font>Consider:<br class=""><font color="#00afcd" class=""><br class=""><br class=""></font>The for-in loop:<br class=""><font color="#00afcd" class=""><br class=""></font><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">repeat</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span></span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">for</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span>x<span class="Apple-converted-space">&nbsp;</span></span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">in</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span></span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">0</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">..&lt;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">5</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span>{</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp; &nbsp;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0);">// code</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">}</span><br class=""><font color="#00afcd" class=""><br class=""></font>The C style for loop and the while loop:<br class=""><font color="#00afcd" class=""><br class=""></font><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">repeat</span><span class="" style="font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span></span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">for</span><span class="" style="font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span></span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">var</span><span class="" style="font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span>i =<span class="Apple-converted-space">&nbsp;</span></span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">0</span><span class="" style="font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span></span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">while</span><span class="" style="font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span>someCondition(i) {</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp; &nbsp;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0);">// code</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">}&nbsp;</span><br class=""><font color="#00afcd" class=""><br class=""><br class=""></font>The repeat while:<br class=""><font color="#00afcd" class=""><br class=""></font><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">repeat</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span></span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">for</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span></span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">var</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span>i =<span class="Apple-converted-space">&nbsp;</span></span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">0</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span>{</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp; &nbsp;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0);">// code</span><br class=""><span class="" style="color: rgb(0, 132, 0); font-family: Menlo; font-size: 11px;">}<span class="Apple-converted-space">&nbsp;</span></span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">while</span><span class="" style="color: rgb(0, 132, 0); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span>someConditionEvaluatedAfterFirstLoop()<span class="Apple-converted-space">&nbsp;</span></span><span class="" style="color: rgb(0, 132, 0); font-family: Menlo; font-size: 11px;">// The i variable would likely have to be considered in scope in the while expression</span><br class=""><font color="#00afcd" class=""><br class=""><br class=""></font>The currently discussed repeat loop<br class=""><font color="#00afcd" class=""><br class=""></font><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">repeat</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span></span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">5</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span>{</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp; &nbsp;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(0, 132, 0);">// code</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">}</span><br class=""><font color="#00afcd" class=""><br class=""></font>All follow a very basic pattern: The repeat keyword followed by a for declaration of loop scoped variables, then either a condition in the case of while or an iterator in the case of for-in. Optionally the language could include an “always” keyword that would specify a set of statements that were guaranteed to execute after each run of the loop. For example:<br class=""><font color="#00afcd" class=""><br class=""></font><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">repeat</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span></span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">for</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span></span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">var</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span>i =<span class="Apple-converted-space">&nbsp;</span></span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">0</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span></span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;">while</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span>i &lt;<span class="Apple-converted-space">&nbsp;</span></span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">5</span><span class="" style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px;"><span class="Apple-converted-space">&nbsp;</span>{</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">&nbsp; &nbsp;&nbsp;</span><br class=""><span class="" style="font-family: Menlo; font-size: 11px;">} always i +=<span class="Apple-converted-space">&nbsp;</span></span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">1</span><br class=""><font color="#272ad8" face="Menlo" class=""><span class="" style="font-size: 11px;"><br class=""></span></font>If this were the case then all current loop constructs and their features could be subsumed by a single type of loop (including the to-be-removed C style for). This does have the problem of increasing the length of some current loop constructs though, specifically for-in.<br class=""><font color="#00afcd" class=""><br class=""></font>Tyler<br class=""><font color="#00afcd" class=""><br class=""><br class=""><br class=""></font><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=DOmV4Qxg-2B1XOnX4CfTyH3sCllXs7myBcgXMCpdkqNW0viJYpkySO22kXjWCOeeSXdj9apwOibzlX25k2sgnNJHwr3OphN6vJh6UDPNRZG9aZvII51sf-2BqQFNGwdMB5-2Bi6PwecdFPsoFg1uuSPTRS-2BSfqrgDCxgXVZAiLjF-2Fy-2FB40By1hefobcRvd1nFOMgLTXZvV-2F8F63AfCTjMP4Kd-2FrLevjnost841KHVmZJt93qA-3D" alt="" width="1" height="1" border="0" class="" style="height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;"><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class=""><div class="">On Dec 8, 2015, at 10:05 PM, André Videla via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><blockquote type="cite" class=""></blockquote><font color="#12c00e" class=""><br class=""></font>How about having a default implementation in the standard library for it?&nbsp;<br class="">We avoid syntactic sugar and we allow for this very simple yet useful expression.<br class="">And we’ve seen solutions in this thread using autoclosurses and extensions<br class=""><font color="#12c00e" class=""><br class=""></font>5.times {<br class="">&nbsp; &nbsp;…<br class="">}<br class=""><font color="#12c00e" class=""><br class=""></font>or a function<br class=""><font color="#12c00e" class=""><br class=""></font>repeat(4) {<br class="">&nbsp; &nbsp;…<br class="">}<br class=""><font color="#12c00e" class=""><br class=""></font>all sound good to me.<br class=""><font color="#12c00e" class=""><br class=""></font>- André<br class=""><font color="#12c00e" class=""><br class=""><br class=""><br class=""></font><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=DOmV4Qxg-2B1XOnX4CfTyH3sCllXs7myBcgXMCpdkqNW1zhhmu5CjhfG-2BP2cjImP8nbF1kxPNzJeSqU-2FN8MEq05R9af7oiQFjalFbSVz-2FM-2FkEhvIrTmq3QcHxHgbzAgfXOAhB4Bb-2Ffjvwkzz2q5H1w7z-2BPIOeIZ1JH2Yl-2FMTVmvoMcxhVvu8prN9FoT6ay4U8Lqe4NkrkrLCUZMyOakSyBdFAa578gBycVgeAnNXAvwRI-3D" alt="" width="1" height="1" border="0" class="" style="height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;"><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">On 09 Dec 2015, at 06:58, Chris Lattner via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><blockquote type="cite" class=""></blockquote><br class="">On Dec 8, 2015, at 4:43 PM, Daniel Steinberg via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">For me this comes up when teaching children or new programmers. (Perhaps not a valid use case)</div></div></div></div></div></blockquote><br class="">This is a very valid use case.<br class=""><br class="">FWIW, “repeat N {}” was originally designed and scoped into the Swift 2 implementation of the feature, but was cut due to schedule limitations. &nbsp;There is precedent for this sort of feature in many teaching oriented languages (e.g. Logo).<br class=""><br class="">I’d say that the pro’s and con’s of this are:<br class=""><br class="">+ Makes a simple case very simple, particularly important in teaching.<br class="">+ Even if you aren’t familiar with it, you can tell at first glance what the behavior is.<br class="">- It is “just syntactic sugar”, which makes the language more complex.<br class="">- It is a very narrow feature that is useful in few practical situations.<br class=""><br class="">-Chris<br class=""><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=41N46VivWCZSszJfIBo5GmyHxjrOakJAcXHty8ZW-2FGhs8teaOUlcVyh8QnI9g7h0iDnLCWCVHmPKUk54l97lzseMpm3DSkV0swNaGZto3zxhnMCqLQO4eo92JbTfmmNB8XrsSs3G-2BE6Bhpo-2FZpKiHAXDZYkMyynnOU2qAQADCwtl8wEB8zy3IqigpG6fQdiX7kYktIL4GEZUVkI-2BmLE0cA-3D-3D" alt="" width="1" height="1" border="0" class="" style="height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;"><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><div class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></div></div></div></blockquote></div></div></div></div></div></div></blockquote></div></div></div></div></blockquote></div><br class=""></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=DOmV4Qxg-2B1XOnX4CfTyH3sCllXs7myBcgXMCpdkqNW3LL3YsfX31sjxDbWD47EY5wSQDYNsXttFXvdRFdv4j3iEQ4wLGoW9h0x9UBqYKL-2BrvthIrYW7IaxHZCknUybN9vJOKwM3rqhc1y5QKx5T58Ea9V11WBNUnEPMNlXdeqMdmp5G6D3bXi04GfxHhtuV-2FtnGSce4rtSAD1DCdo0QW3CFJyjYLntBU5B0ta2gMv-2BI-3D" alt="" width="1" height="1" border="0" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space">&nbsp;</span></span><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-evolution@swift.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></div></div></body></html>