Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site ur-cvsvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!rochester!ur-cvsvax!bill From: bill@ur-cvsvax.UUCP (Bill Vaughn) Newsgroups: net.lang.c Subject: Re: Re: for <==> while (an exception) Message-ID: <201@ur-cvsvax.UUCP> Date: Mon, 15-Jul-85 14:03:53 EDT Article-I.D.: ur-cvsva.201 Posted: Mon Jul 15 14:03:53 1985 Date-Received: Thu, 18-Jul-85 02:57:18 EDT References: <200@ur-cvsvax.UUCP> <1280@eagle.UUCP> Distribution: net Organization: Center for Visual Science, U. of Rochester Lines: 24 > > Section 3.5 of K&R (p. 56) states that the 'for' loop and 'while' loop > > can be made equivalent.... > > > > Well ... almost. > > If 'statement' contains a 'continue' statement, things may go awry. > > If you look in the reference manual which is contained in K&R, you will see > that the semantics of the continue statement are fully described in terms of > equivalences among while, do-while, and for loops. Section 9.9 (p. 203) clears > up the `exception' you perceive. Please bear in mind that the section that you > quoted is part of a tutorial, and so all the gory details aren't presented at > once or in the same place. > -- > Marty Shannon I'm not questioning the sematics of the continue statement in C (the necessity, ... well maybe), but I was simply pointing out that if anyone wanted to change a 'for loop' to a 'while loop' he/she had better watch out for continue's. By the way, the exception 'continues' to go unmentioned in section 9.6 and I cannot see that it is brought up in section 9.9 either. (Maybe it was TOO gory to bring up. :-) Bill Vaughn UUCP: {allegra,seismo,decvax}!rochester!ur-cvsvax!bill