Liste des Groupes | Revenir à cl c |
Kaz Kylheku <643-408-1753@kylheku.com> writes:
[...]One programming language that has comma separators is Fortran,>
by the way. Fortran persisted in providing this feature in spite of
shooting itself in the foot with ambiguities.
>
When Fortran was being designed, people were naive in writing
compilers. They thought that it would simplify things if they
removed all spaces from the code before lexically scanning it and
parsing.
>
Thus "DO I = 1, 10" becomes "DOI=1,10" and "FO I = 1, 10"
becomes "FOI=1,10"
>
After that you have to figure out that "DOI=1,10" is the
header of a DO loop which steps I from 1 to 10,
whereas "FOI=1,10" assigns 110 to variable FOI.
I don't think that's correct. My quick experiments with gfortran
indicate that commas are *not* treated as digit separators.
>
The classic Fortran (or FORTRAN?) error was that:
DO 10 I = 1,100
(a loop with bounds 1 to 100) was written as:
DO 10 I = 1.100
(which assigns the value 1.100 to the variable DO10I).
>
An urban legend says that this error caused the loss of a spacecraft.
In fact the error was caught and corrected before launch.
Wow, consistency. And no dangling comma nonsense to deal with in>
complex, variadic macros!
Would MAC("foo" "bar") have one argument or two?
Les messages affichés proviennent d'usenet.