fortran to C converter

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Apr 27 13:41:12 AEST 1989


In article <12716 at lanl.gov> jlg at lanl.gov (Jim Giles) writes:
>Yes. For example, why does C treat a carriage return as whitespace?
>Nobody programs like that.  Most people put _one_ statement per line,
>so the use of _both_ semicolon and carriage return as statement terminators
>seems redundant.  Why does C choose to ignore the "wrong" one?

I'll choose to treat this as an honest request for information..
I'll also assume you're taking about new-lines, not strictly CRs.

Many programming environments work best when source file line lengths
are limited, typically to no more than 80 characters (the exact useful
limit varies).  There are many instances in C coding when the natural
expression of a simple statement (not talking about entire loops, etc.,
but rather things like expression statements) simply does not fit on a
single line within such a length limit.  This especially happens when
8-column tab stops are involved (which often is the best-supported or
ONLY supported tab spacing), but it would occur even if one started
every statement in the first position of a line.  Therefore, allowing
simple statements to span multiple lines is a practical convenience for
the programmer.

RatFor is an example of a language that attempted to support line
spanning while simultaneously treating new-line as a statement
terminator most of the time.  It worked okay but was rather ad-hocish;
a uniform simple rule such as C has seems better to me.



More information about the Comp.lang.c mailing list