4 ms·
i challenge the decision to not have explicit loops. the beauty of the original C construction was that it allowed for 3 events to occur inside each iteration:
by magicmouse 7y ago
i challenge the decision to not have explicit loops. the beauty of the original C construction was that it allowed for 3 events to occur inside each iteration: 1) normal execution of the body, 2) skip over the body but increment the counter, 3) exit the loop. When you have nested loops JS and AS3 let you name the outer loop and break out of it (thus re-introducing the FORTRAN GOTO which although that crank Dijkstra hated so much, occasionally is needed for this purpose). How are you going to stop a loop that might go on too long? sometimes you want to stop early. I don't see how you can stop the map().. or filter() operators. Just because early abort of a loop is not common doesn't mean it doesn't come up; it does inevitably so.
- dragonwriter 7y agoNamed loop breakouts aren't the e GOTO Djikatra was concerned aboutvbecause they are still block structured; “harmful” GOTOs are arbitrary, structure-defying jumps. Named loop breakouts do not break the coordinate-assignment capacity that Djikstra takes GOTOs to task for breaking. > I don't see how you can stop the map().. or filter() operators. You use an early-terminating operator like find or take. (The general solution is probably Clojure-style transducers, which compose in a way which enables, among other things, plugging termination conditions into an operator which otherwise isn't early terminating.)