Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!mcnc!ncsu!uvacs!edison!steinmetz!davidsen From: davidsen@steinmetz.UUCP (Davidsen) Newsgroups: net.lang.c Subject: Re: Infinite loops Message-ID: <725@steinmetz.UUCP> Date: Tue, 6-May-86 15:22:29 EDT Article-I.D.: steinmet.725 Posted: Tue May 6 15:22:29 1986 Date-Received: Thu, 8-May-86 22:03:20 EDT References: <117@brl-smoke.ARPA> <116@cbmvax.cbmvax.cbm.UUCP> Reply-To: davidsen@kbsvax.UUCP (Davidsen) Organization: GE CRD, Schenectady, NY Lines: 35 In article <116@cbmvax.cbmvax.cbm.UUCP> grr@cbmvax.UUCP (George Robbins) writes: >In article <117@brl-smoke.ARPA> gwyn@BRL.ARPA (VLD/VMB) writes: >> >>do ... while(1); >>while(1) ... >>for(;;) ... >> >>are all widely-used idioms for unconditional looping in C. >>I personally prefer the latter, but the choice is just a >>matter of taste. Any reasonable compiler will generate >>efficient code for all three constructs. > >#define loop for(;;) > >This is a clean way to do it, but be aware that there is no obvious stopping >point, and soon C purists will soon be declaring that your code has been tainted >by exposure to noxious influences from Algol 68 or worse... > You could change the definition(s) to: #define loop for(;;){ #define endloop } Or, as I have seen in a few programs: #define ever (;;) -- -bill davidsen seismo!rochester!steinmetz!--\ / \ ihnp4! unirot ------------->---> crdos1!davidsen \ / chinet! ---------------------/ (davidsen@ge-crd.ARPA) "Stupidity, like virtue, is its own reward"