Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: do { quit; } else { } Date: Sun, 13 Apr 2025 14:58:11 -0700 Organization: None to speak of Lines: 23 Message-ID: <87lds3g1vw.fsf@nosuchdomain.example.com> References: <20250410080629.532@kylheku.com> <87a58mqt2o.fsf@nosuchdomain.example.com> <875xjaqmgf.fsf@nosuchdomain.example.com> <20250412101325.877@kylheku.com> <20250413214046.0000530f@yahoo.com> <20250413130116.546@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sun, 13 Apr 2025 23:58:12 +0200 (CEST) Injection-Info: dont-email.me; posting-host="524b4d7773c87d22edfb66b0f92ad1e6"; logging-data="3953434"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QNM4G7ul8I+BZwaXJxEZa" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:paWrLISCNKPiCnUEkiGgQpeMfMo= sha1:YqbmZMKbaepA2giz3kP0UsoAezU= Xref: csiph.com comp.lang.c:392477 Kaz Kylheku <643-408-1753@kylheku.com> writes: > On 2025-04-13, Michael S wrote: >> The funny thing is that in original C prefix form of [] indexing was >> equivalent to the postfix form. May be, it still is in C23, I didn't >> try to look in the docs or test. > > Are you thinking of a[i] being *(a + i) being i[a] due to commutativity? > > That's really not a useful feature. Actually right down to a + i being > commutative when a is a pointer. It would be fine if only the > + combination were allowed. Agreed. The feature goes back to B, which was largely untyped, and there wasn't a strong distinction between integers and pointers. An expression like 5[6] would refer to a memory location, and depending on the system it might even work. The transition from B to C was an opportunity to restrict the ordering of the operands, but it wasn't taken. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */