Sujet : Re: Loops (was Re: do { quit; } else { })
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 16. Apr 2025, 21:03:24
Autres entêtes
Organisation : None to speak of
Message-ID : <878qnz27sj.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
User-Agent : Gnus/5.13 (Gnus v5.13)
bart <
bc@freeuk.com> writes:
On 16/04/2025 06:35, Janis Papanagnou wrote:
On 15.04.2025 22:46, bart wrote:
On 15/04/2025 20:07, Scott Lurndal wrote:
[...]
Real for loops _are_ a three-way construct.
>
[...]
>
Any step other than 1 is unusual. [...]
>
Nonsense. Arithmetic loop steps other than one are noting unusual
and been supported by programming languages (and also been used)
since decades in programming.
>
So what are you claiming, that the majority of loops in any given
program will have steps other than +1 or -1?
Exactly, because "unusual" and "the majority" are the only
possibilities.
Try assuming that other people are not malicious idiots who are
out to get you.
[...]
Here's the actual point. Some languages have a simple looping
construct that only allows an increment of +1, or perhaps +1 and
-1. That's useful, and it does cover most of the common cases.
Some languages have a looping construct that allows arbitrary
increment values. That's a little more complex, but it covers
more cases. Some languages, like C, have a looping construct
(C calls it "for") that allows any arbitrary "increment" action,
while still being only a little more verbose for the common cases (no
doubt you'll disagree on the latter, since you're fond of counting
tokens or keystrokes as a measure of difficulty). Again, that's a
bit more complicated, but it's extremely powerful, and covers even
more cases that aren't covered by a simpler +1/-1 for loop.
Not surprisingly, different people have different preferences for
what a language should support. And a lot of people don't spend
their time complaining about what constructs a language *should*
support, but get on with using what a language offers.
We know your opinion. I for one acknowedge that your opinion
is valid, and you're entitled to hold it. We're just tired
of you making the same point again and again and again, while
misrepresenting those of us who hold different opinions.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */