Re: For loops
- Posted by Matt Lewis <matthewwalkerlewis at gma??.com> Nov 20, 2007
- 584 views
CChris wrote: > > Pete Lomax wrote: > > > > I still say that adding a new for_existing construct now seems pointless. > > > > Well, I'm not a staunch supporter of this. It was just the most consistent way > imho to accommodate requests that were made. We can decide that the while loop > is good enough for these cases - though using the same construct for many > different > purposes doesn't help writing clearer code. I think that there's a legitimate place for something like the C-style for-loop. It gives us a fairly well structured while loop that I think makes for clearer code, since the mechanics of the loop are declared before hand, but you have much greater freedom in choosing your method of iteration and termination. Matt