<div dir="ltr"><font face="arial, helvetica, sans-serif" color="#000000">Does this debate not arise from a common duality of purpose of the "for (;;)" construct?</font><div><div><font face="arial, helvetica, sans-serif" color="#000000">[in passing, and to acknowledge its longevity, I'll note I first saw this "FOR .." years ago when learning FORTRAN]</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#000000">--> Iterating Through the Members of a Collection .. Erica's proposal hits this first usage nicely because, typically, the 'index' value is irrelevant so why force its existence? I think everyone is happy that the old construct is exorcised for this case.</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#000000">--> Generating Values of a Variable Local to the Loop .. or the "scientific, engineering, statistical, technical" use that Ted refers to. In this case the "for (;;)" loop's purpose *is* the generation of the 'index' value, and the old construct does this more nicely than the new [though I'll moderate my enthusiasm in a moment].</font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><br></font></div><div><br></div><div><font color="#000000" face="arial, helvetica, sans-serif">When you consider the total power of the "for (;;)" usage, several </font><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">awesome, and ghastly,</span><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif"> </span><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">things emerge. You'll think of more, but I think of using a non-integer index; I think of </span><font color="#000000" face="arial, helvetica, sans-serif">compound statements before, after and between the semi-colons; I think of the central conditional and </font><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">the number of times that I have fallen prey to an off-by-one error; I think of the final 'iteration' as being an </span><font color="#000000" face="arial, helvetica, sans-serif">arbitrary computation.</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">A simple example might be: </font><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">for (altitude = 0.1; altitude < 10e6; altitude =* 10.0) { . . . }</span></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">The two purposes I'm drawing out are not mutually exclusive, of course. They're more like the ends of continuum of purposes, and each end can be implemented (torturously?) by the others end's syntax. We've focused attention on one end in SE-0007; now we need to do the same for the other end. I look forward to Ted's suggestion for an elegant expression of the "</font><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">scientific, engineering, statistical, technical" </span><font color="#000000" face="arial, helvetica, sans-serif">usage.</font><br></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">Finally, I'll note that when SE-0007 was being considered, I asked how I might do the second case (I needed to span Doubles from X to Y in jumps of Z. The best answer (of several), at that time, was:</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)"> extension</span> <span style="color:rgb(112,61,170)">ClosedInterval</span> <span style="color:rgb(187,44,162)">where</span> Bound: Strideable {</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(112,61,170)"><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(187,44,162)">func</span><span style="color:rgb(0,0,0)"> by(n: </span>Bound<span style="color:rgb(0,0,0)">.</span>Stride<span style="color:rgb(0,0,0)">) -> </span>StrideThrough<span style="color:rgb(0,0,0)"><</span>Bound<span style="color:rgb(0,0,0)">> {</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> <span style="color:rgb(187,44,162)">return</span> <span style="color:rgb(112,61,170)">start</span>.<span style="color:rgb(61,29,129)">stride</span>(through: <span style="color:rgb(112,61,170)">end</span>, by: n)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> }</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> }</p></div><div><br></div><div>and </div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> <span style="color:rgb(187,44,162)">for</span> angle <span style="color:rgb(187,44,162)">in</span> (<span style="color:rgb(39,42,216)">X</span>...<span style="color:rgb(39,42,216)">Y</span>).<span style="color:rgb(49,89,93)">by</span>(<span style="color:rgb(39,42,216)">Z</span>) { . . }</p></div><div><br></div><div><font color="#000000" face="arial, helvetica, sans-serif">We can do better.</font></div><div><br></div><div><br></div><div class="gmail_extra"><div class="gmail_quote">On Sat, Mar 19, 2016 at 2:58 PM, Patrick Gili via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">I understand this. I am looking forward to see what Ted proposes.<div><br></div><div>-Patrick</div><div><div><div><br><div><blockquote type="cite"><div>On Mar 19, 2016, at 2:31 PM, Ross O'Brien <<a href="mailto:narrativium+swift@gmail.com" target="_blank">narrativium+swift@gmail.com</a>> wrote:</div><br><div><div dir="ltr">But the discussion is no longer about 'do we really need to take this feature out?'. The feature is already out. It's deprecated in Swift 2.2. The discussion is 'is there a compelling reason to put it back in again?'.<div><br></div><div>We still have for-in loops. We still have repeat while. We still have forEach. Iteration isn't going anywhere; it just doesn't have this peculiar semi-colon structure any more. It's a confusing structure for beginning programmers to learn in the first place, and Swift doesn't use semi-colons so much.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 19, 2016 at 6:06 PM, Patrick Gili via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span><blockquote type="cite"><div>On Mar 18, 2016, at 7:19 PM, Ted F.A. van Gaalen <<a href="mailto:tedvgiosdev@gmail.com" target="_blank">tedvgiosdev@gmail.com</a>> wrote:</div><br><div><div style="word-wrap:break-word"><div>On Chris’s advice, I’ve spawned this into a new discussion topic, for which the base could be</div><div>part of what I wrote in relation to SE-0007. </div><div><br></div><div><br></div>Hello Patrick<div>as I wrote: <br><div><div><blockquote type="cite"><div style="word-wrap:break-word"><div><div><blockquote type="cite"><div><div style="word-wrap:break-word"><div style="margin:0px;line-height:normal;color:rgb(4,51,255)"><span style="font-size:12px"></span></div></div></div></blockquote></div></div></div></blockquote><div style="word-wrap:break-word"><div><div><div><div style="word-wrap:break-word"><div style="margin:0px;line-height:normal;color:rgb(4,51,255)"><span style="font-size:12px">As a result of removing the classical for loop it is to be expected that lot of people might consider thinking twice about switching to Swift, If they have to live without (or cumbersome work around) language elements that have proven to be very useful for at least a few decades...</span></div></div></div></div></div></div></div></div></div></div></div></blockquote><div><br></div></span><div>There are two groups of people to consider:</div><div><br></div><div>1) OS X and iOS developers; this group is stuck with whatever the language brings them, for good or bad. If this group of people doesn't like a decision made by the community, they can grumble about it for awhile, suck in a deep breath, and move on.</div><div><br></div><div>2) Others; this group may be considering using Swift to develop software on other platforms and in other environments. If this group of people doesn't like a decision made by the community, they may think twice and it could significantly impact the uptake by this group of developers. I think it is wise that the community lubricate the transition to Swift as much as possible for this group of developers. I ask if leaving this kind of syntax in the language is so bad? Does it fall in the same category as removing function currying? My gut tells me not, but I could be wrong.</div><span><br><blockquote type="cite"><div><div style="word-wrap:break-word"><div><div><div><br></div><div>I also find it of the most importance to keep Swift accessible for all kinds of programmers</div><div>from starters to academic. </div><div><br></div><div>Graig Federighi said </div><div><i style="color:rgb(108,108,108);font-family:'Museo Slab',serif;font-size:26px;text-align:center;border:0px;vertical-align:baseline;margin:0px;padding:0px">We think it should be everywhere and used by everyone.</i></div><div><br></div><div><i style="color:rgb(108,108,108);font-family:'Museo Slab',serif;font-size:26px;text-align:center;border:0px;vertical-align:baseline;margin:0px;padding:0px"><br></i></div><div>I subscribe to that.</div><div><br></div><div><br></div><div>-TedvG</div><div><br></div><div><br></div></div></div></div></div></blockquote></span></div><br></div><br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></div><br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div></div></div>