Liste des Groupes | Revenir à cl c |
(While there's some "C" stuff in here it contains a lot of non-"C"[...]
samples for comparison. So [OT]-sensible folks may want to skip this
post.)
On 14.04.2025 12:16, bart wrote:
Fortran's loops looked like this:>
do 100 i = a, b
s1
s2
...
100 continue
Okay, I see what you want; just two values (from, to).
>
This Fortran stuff looks really sick (for my taste)! - The "do 100"
sounds like iterating 100 times, line numbers, 'continue' keyword,
and a list a,b meaning iteration over a range. - Can it be worse?
(Later Fortran versions allow a slightly better syntax, but it's
basically the same anachronistic crude syntax.)
In _minimalistic_ languages I'd prefer, for example, a style like
in Pascal (or in similar languages)
>
for i := a to b do
statement_block;
>
It's simple, and a clean formalism.
>>
The C equivalant is this:
for (i = a; i <= b; ++i)
stmt
Differences:
* Fortran has an official loop index variable 'i'.
You are saying that you could not use 'j' ? (This is certainly
different from my memories.) - Anyway, having dedicated variables
for integer types is sick in itself, also if used without loop.
Les messages affichés proviennent d'usenet.