Liste des Groupes | Revenir à cl c |
On 19.04.2025 12:26, bart wrote:With the optional step (which is so uncommonly used that I'd forgotten it even had it), it handles the vast majority of loops where you want a variable to iterate over a range.On 19/04/2025 07:27, Janis Papanagnou wrote:Why is that not primitive? It is about the most restricted loopOn 19.04.2025 00:27, bart wrote:>>So, yes, I think that is problematic, and the fault is with the>
language. This stuff isn't not hard to get right; even BASIC manages to
FOR-loops properly.
As so often explained to you, BASIC has a most primitive loop.[*]
As has been so often pointed out, the vast majority of iterating loops
can be accommodated by 'for i = a to b'. So in that case it is not
primitive.
concept one can think of;
I'm doing hard to imagine a yet moreC, really?
primitive one. All other loops pointed out that far (Algol 68,
Simula, "C") allow more complex (less primitive) loop constructs.
So has 'if' and 'goto'. (I think we've been here before!)>Yet has higher expressiveness.
However C's for-loop genuinely *IS* primitve.
We disagree what "primitive" means;I'll tell you a secret: a few years ago, I also added a C-style 'for' statement to my language. So it had two kinds of 'for' that looked like this:
so it's hard to continue the discussion below since we're speaking
different languages, obviously.
I understand that the "C" language designers decided to not provideMine is too. The original version was even lower level and simpler and smaller, but it still had PRINT and FOR.
some additional form of loops; that's IMO a sensible decision given
what low-level language "C" is.
form by building blocks as we know them from other places in theLots of people do.
"C" language makes perfectly sense.
I don't need a second loop in "C". I know it would help you to not
make the errors you seem to regularly make as you say.
Really? So why does this work:>No. You have a complete misconception about that. In all respects.
In fact, WHY does Awk have that other kind of loop? Since the primitive
form can express it just as well.
don't use that language. Why are you here, in CLC; just to complain?I'm here to understand why people are deifying C and its crude for-loop by arguing that black is white:
Les messages affichés proviennent d'usenet.