<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=""><div class="">I mentioned this is in another thread, but I like the current for loop structure because it’s pretty clear when you name things well, like so:</div><div class=""><br class=""></div><div class=""><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>for eachValue in theValues {</font> … <span style="font-family: Monaco;" class="">}</span></div><div class=""><br class=""></div><div class="">This is a holdover from my love of Applescript (the language, the runtime performance can bite me), it’d be nice if I could use the “do” keyword to define the block, as that would complete the sentence, but I think that’s pretty clear personally.</div><br class=""><div><blockquote type="cite" class=""><div class="">On 30 Mar 2016, at 20:54, Nathanial Burton-Bradford via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">Swift Control Flow using Loops </span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">One of Swifts strengths is clear, readable INTENT, conveyed by the languages Keyword tokens. For anyone new to programming, clear, readable intent, goes a long way in helping them master the language, by helping reduce
logical/semantic errors caused by a misunderstanding of the names used in specifying the languages keyword tokens…</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">Swift’s control flow keywords can be ambiguous, in this respect, when conveying the functional intent of loop control logic, within the language.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">I would like to open up discussion, therefore, regarding the possible renaming of Swift’s control flow keywords, with the hope that this leads to clearer INTENT regarding loops. </span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">Replace For-In with </span><span style="-webkit-font-kerning: none; color: rgb(107, 33, 133); -webkit-text-stroke-color: rgb(107, 33, 133);" class="">Loop Using </span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">for foo in d…y <span class="Apple-tab-span" style="white-space:pre">
</span></span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">loop</span><span style="font-kerning: none" class=""> foo
</span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">using</span><span style="font-kerning: none" class=""> d…y</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">For x in 1…5<span class="Apple-tab-span" style="white-space:pre">
</span></span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">loop</span><span style="font-kerning: none" class=""> x
</span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">using</span><span style="font-kerning: none" class=""> 1…5</span></div>
<div class=""><br class="">
</div>
<div class="">
<div style="-webkit-text-stroke-width: initial; margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0);" class="">
<span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">loop</span><span style="-webkit-font-kerning: none;" class=""> i=0 </span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">using</span><span style="-webkit-font-kerning: none;" class=""> i<10</span></div>
<div style="-webkit-text-stroke-width: initial; margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); min-height: 13px;" class="">
<span style="-webkit-font-kerning: none;" class=""></span><br class="">
</div>
<div style="-webkit-text-stroke-width: initial; margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0);" class="">
<span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">loop</span><span style="-webkit-font-kerning: none;" class=""> i </span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">using</span><span style="-webkit-font-kerning: none;" class=""> 0..<10</span></div>
<div style="-webkit-text-stroke-width: initial; margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); min-height: 13px;" class="">
<span style="-webkit-font-kerning: none;" class=""></span><br class="">
</div>
<div style="-webkit-text-stroke-width: initial; margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); min-height: 13px;" class="">
<span style="-webkit-font-kerning: none;" class=""></span><br class="">
</div>
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">For _ in 1 …power<span class="Apple-tab-span" style="white-space:pre">
</span></span><span class="Apple-tab-span" style="white-space: pre;"></span>———-><span class="Apple-tab-span" style="white-space: pre;">
</span><span style="-webkit-text-stroke-width: initial; -webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">loop using</span><span style="-webkit-text-stroke-width: initial; -webkit-font-kerning: none;" class="">
1…power</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">“The underscore character (_) used in place of a loop variable causes the individual values to be ignored and does not provide access to the current value during each iteration of the loop.”</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">I feel underscore character (_) is confusing, semantically. </span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<br class="">
<span style="font-kerning: none" class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">let names = ["Anna", "Alex", "Brian", “Jack"]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">for name in names {<span class="Apple-tab-span" style="white-space:pre">
</span>———-><span class="Apple-tab-span" style="white-space:pre"> </span></span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">loop</span><span style="font-kerning: none" class="">
names </span><span style="-webkit-font-kerning: none; color: rgb(107, 33, 133); -webkit-text-stroke-color: rgb(107, 33, 133);" class="">using</span><span style="font-kerning: none" class=""> name {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> print("Hello, \(name)!")</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">Note : </span><span style="-webkit-font-kerning: none; color: rgb(107, 33, 133); -webkit-text-stroke-color: rgb(107, 33, 133);" class="">loop</span><span style="font-kerning: none" class=""> ARRAY
</span><span style="-webkit-font-kerning: none; color: rgb(107, 33, 133); -webkit-text-stroke-color: rgb(107, 33, 133);" class="">using</span><span style="font-kerning: none" class=""> ELEMENT(S) - which is logically consistent with ‘-using’ as last keyword
instance.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">let numberOfLegs = ["spider": 8, "ant": 6, "cat": 4]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">for (animalName, legCount) in numberOfLegs {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> print("\(animalName)s have \(legCount) legs")</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">loop</span><span style="font-kerning: none" class=""> numberOfLegs
</span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">using
</span><span style="font-kerning: none" class="">(animalName, legCount) {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""><span class="Apple-tab-span" style="white-space:pre"></span>print(“ \(animalName)s have \(legCount) Legs”)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">Note : Again </span><span style="-webkit-font-kerning: none; color: rgb(107, 33, 133); -webkit-text-stroke-color: rgb(107, 33, 133);" class="">loop</span><span style="font-kerning: none" class=""> ARRAY
</span><span style="-webkit-font-kerning: none; color: rgb(107, 33, 133); -webkit-text-stroke-color: rgb(107, 33, 133);" class="">using</span><span style="font-kerning: none" class=""> ELEMENT(S) - which is logically consistent with ‘-using’ as last keyword
instance.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">for (airportCode, airportName) in airports {<span class="Apple-tab-span" style="white-space:pre">
</span></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">loop</span><span style="font-kerning: none" class=""> airports
</span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">using
</span><span style="font-kerning: none" class="">(airportCode, airportName)</span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class=""> </span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">for airportCode in airports.keys {<span class="Apple-tab-span" style="white-space:pre">
</span></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">loop</span><span style="font-kerning: none" class=""> airports.keys
</span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">using
</span><span style="font-kerning: none" class="">airportCode</span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">
</span><span style="font-kerning: none" class="">{</span></div><p style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""> </span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">for airportName in airports.values {<span class="Apple-tab-span" style="white-space:pre">
</span></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">loop</span><span style="font-kerning: none" class=""> airports.values
</span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">using
</span><span style="font-kerning: none" class="">airportName</span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">
</span><span style="font-kerning: none" class="">{</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">for value in array[1..<array.count] {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">loop</span><span style="font-kerning: none" class=""> array[1..<array.count]
</span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">using
</span><span style="font-kerning: none" class="">value</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">‘while’ using </span><span style="-webkit-font-kerning: none; color: rgb(107, 33, 133); -webkit-text-stroke-color: rgb(107, 33, 133);" class="">loop while</span><span style="font-kerning: none" class=""> </span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="-webkit-font-kerning: none; color: rgb(107, 33, 133); -webkit-text-stroke-color: rgb(107, 33, 133);" class="">loop while</span><span style="font-kerning: none" class=""> square < finalSquare {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> // roll the dice</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> diceRoll += 1</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> if diceRoll == 7 { diceRoll = 1 }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> // move by the rolled amount</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">Control transfer statements</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">repeat { <span class="Apple-tab-span" style="white-space:pre">
</span>——><span class="Apple-tab-span" style="white-space:pre"> </span></span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">loop</span><span style="font-kerning: none" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">…</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">} while </span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">“Break</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">The break statement ends execution of an entire control flow statement immediately. ”</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">I propose replacing Break, in loops, with
</span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">exit now</span><span style="font-kerning: none" class=""> (intent is explicit)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">Note: Labeled Statements with break - </span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""><span class="Apple-tab-span" style="white-space:pre"></span>break gameLoop
<span class="Apple-tab-span" style="white-space:pre"></span></span><span style="-webkit-font-kerning: none; color: rgb(107, 33, 133); -webkit-text-stroke-color: rgb(107, 33, 133);" class="">exit now</span><span style="font-kerning: none" class=""> gameLoop</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">“Continue</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">The continue statement tells a loop to stop what it is doing and start again at the beginning of the next iteration through the loop.”</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">“switch character {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> case "a", "e", "i", "o", "u", " ":</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; color: rgb(85, 19, 107); -webkit-text-stroke-color: rgb(85, 19, 107); -webkit-text-stroke-width: initial;" class="">
<span style="-webkit-font-kerning: none; -webkit-text-stroke-color: rgb(0, 0, 0);" class=""> continue
<span class="Apple-tab-span" style="white-space:pre"></span></span><span style="font-kerning: none" class="">// Continue what? to next line? to end? to beginning?</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> default:</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> puzzleOutput.append(character)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> }”</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">I propose replacing continue with </span>
<span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">next cycle
</span><span style="font-kerning: none" class="">or</span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class=""> next loop</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">“switch character {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> case "a", "e", "i", "o", "u", " ":</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; color: rgb(107, 33, 133); -webkit-text-stroke-color: rgb(107, 33, 133); -webkit-text-stroke-width: initial;" class="">
<span style="-webkit-font-kerning: none; -webkit-text-stroke-color: rgb(0, 0, 0);" class="">
</span><span style="-webkit-font-kerning: none; color: rgb(148, 33, 147); -webkit-text-stroke-color: rgb(148, 33, 147);" class="">next cycle</span><span style="-webkit-font-kerning: none; -webkit-text-stroke-color: rgb(0, 0, 0);" class="">
<span class="Apple-tab-span" style="white-space:pre"></span></span><span style="font-kerning: none" class="">// intent is explicit</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> default:</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> puzzleOutput.append(character)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class=""> }”</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class="">
<span style="font-kerning: none" class="">Note: Labeled Statements with Continue - as per Break example,
</span><span style="-webkit-font-kerning: none; color: rgb(107, 33, 133); -webkit-text-stroke-color: rgb(107, 33, 133);" class="">next cycle gameLoop</span><span style="font-kerning: none" class=""> </span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class="">
<span style="font-kerning: none" class=""></span><br class="">
</div>
</div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>