|
|
|
|
|
by adrusi
4014 days ago
|
|
What do you consider a for loop to be? The loop constructs called "for" that existed prior to C all just iterated through a numeric sequence with an optional step parameter. This was present in BASIC, ALGOL68 and Pascal. The C for loop was designed by looking at an ALGOL-style for loop: FOR i FROM 1 BY 2 TO 3 WHILE i≠4 DO ~ OD
and trying to make the construct not tied to integer sequences (because such a specific construct would be out of place in C). The typical for loop, like the one in your comment, has a begin, end and increment parameter, just like the ALGOL example.I assume you mean that you'd prefer some kind of for-each kind of loop, but in order to support that, a language needs a formalized concept of iterators, which may be out of scope for the project. |
|