Xref: utzoo comp.lang.modula2:1239 comp.lang.c:15886 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!mentor.cc.purdue.edu!s.cc.purdue.edu!ags From: ags@s.cc.purdue.edu (Dave Seaman) Newsgroups: comp.lang.modula2,comp.lang.c Subject: Re: "for" loops (was Re: C++ vs. Modula2) Message-ID: <3747@s.cc.purdue.edu> Date: 27 Jan 89 19:09:13 GMT References: <739@jupiter.iis.UUCP> <1611@csuna.UUCP> <738@atanasoff.cs.iastate.edu> <19579@agate.BERKELEY.EDU> Reply-To: ags@s.cc.purdue.edu (Dave Seaman) Organization: Purdue University Lines: 23 In article <19579@agate.BERKELEY.EDU> bowles@eris.berkeley.edu (Jeff A. Bowles) writes: > If I had a nickel for every time, in Fortran, > that I needed a loop that ran from 0.0 to 1.0 by 0.1 (or the like) and > had to use INTEGER to do it. Fortran does not require an integer. The control variable of a DO loop may be integer, real, or double precision. It is perfectly legal to write: REAL X . . . DO 10 X=0.0, 1.0, 0.1 . . . according to the current standard, but this has been recognized as a mistake which will probably be rectified in the next standard. You can't even tell how many iterations you will get from the DO statement above (10? 11? how do you know?). Why anyone would want to add this deficiency to a language that doesn't currently have broken FOR statements is beyond me. -- Dave Seaman ags@j.cc.purdue.edu