Path: ...!feeds.phibee-telecom.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Whaddaya think? Date: Tue, 18 Jun 2024 17:55:36 -0700 Organization: None to speak of Lines: 48 Message-ID: <87tthpycmv.fsf@nosuchdomain.example.com> References: <666ded36$0$958$882e4bbb@reader.netnews.com> <87ed8x4zjl.fsf@nosuchdomain.example.com> <666f10b7$0$1412896$882e4bbb@reader.netnews.com> <20240617003207.452@kylheku.com> <86msnik9a7.fsf@linuxsc.com> <87msnizhmr.fsf@nosuchdomain.example.com> <86bk3xixtf.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Wed, 19 Jun 2024 02:55:37 +0200 (CEST) Injection-Info: dont-email.me; posting-host="14c46e9d4441e9b6d7e573ea203ad727"; logging-data="1690205"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+xtFGjPXptLeMyOW8yYYf/" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:6RSMf0n8V5jVIiaxMvcyi7Yu5UQ= sha1:TEMJ4oieC9ct2GMPN6zQ4ql1ofk= Bytes: 3069 Tim Rentsch writes: > Keith Thompson writes: > >> Tim Rentsch writes: >> >>> Kaz Kylheku <643-408-1753@kylheku.com> writes: >>> >>>> Speaking of while, the do/while construct does not require parentheses >>>> in order to disambiguate anything, since it has a mandatory semicolon. >>>> Yet, it still has them. >>> >>> It has them to allow an extension for a "loop-and-a-half" control >>> structure: >>> >>> do statement while ( expression ) statement >>> >>> and so for example >>> >>> do c = getchar(); while( c != EOF ) n++; >>> >>> to count characters on standard input. >> >> Oh? Do you have any evidence that that was the intent? [...] > > I think you're reading something into my remark that it > didn't say. Or at least that you didn't mean. What did you actually meant by "It has them to allow an extension ...."? It seemed very clear to me that you meant to imply an intent, and I can't think of any other sensible interpretation of your words. do-while *could* have been specified without required parentheses. The only reason I can think of that it wasn't is consistency with other constructs (if, for, while), and in my opinion that's a perfectly valid reason. If you're seriously suggesting that there's another reason, I'd be interested in learning about it. If any existing compiler has the loop-and-a-half extension you mentioned, or anyone even considered such an extension, I'd be interested in learning about that as well. (If it was a joke, just say so and we can drop this.) Of course you could have explained what you meant in the first place. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */