🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #4590

Re: "for" loops (was Re: C++ vs. Modula2)

#4590
From: Ken Arromdee
Date: Sat, 28 Jan 1989 00:11
15 lines
1251 bytes
>Actually, C's "for" can be duplicated EXACTLY by C's "do ... while" loops.

I suspect you're going to get an awful lot of flames for saying this.  What
about
	for(i=0; i<=j; i++)
		printf("%d\n",i);
Since a do-while loop has the test condition at the termination of the loop,
it is not possible to produce an equivalent do-while version, for the
behavior will differ if j is less than 0.
--
               EARTH                  --Kenneth Arromdee
           smog  |   bricks          UUCP: ....!jhunix!ins_akaa
        AIR     mud       FIRE   INTERNET: arromdee@crabcake.cs.jhu.edu
      soda water |   tequila       BITNET: g49i0188@jhuvm
               WATER           (please, no mail to arrom@aplcen)
Technical Details
Message-ID: <608@aplcen.apl.jhu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!mimsy!haven!aplcen!arrom
References: <INFO-M2%89011219330825@UCF1VM> <739@jupiter.iis.UUCP> <1611@csuna.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!mimsy!haven!aplcen!arrom
From: arrom@aplcen.apl.jhu.edu (Ken Arromdee)
Newsgroups: comp.lang.modula2,comp.lang.c
Subject: Re: "for" loops (was Re: C++ vs. Modula2)
Message-ID: <608@aplcen.apl.jhu.edu>
Date: 28 Jan 89 00:11:29 GMT
References: <INFO-M2%89011219330825@UCF1VM> <739@jupiter.iis.UUCP> <1611@csuna.UUCP>
Reply-To: arrom@aplcen.apl.jhu.edu (Ken Arromdee (600.429))
Followup-To: comp.lang.modula2
Organization: Johns Hopkins University
Lines: 15