Article View: comp.lang.c
Article #516Re: Taming The Switch-Statement
From: Michael S
Date: Sun, 18 Oct 2026 16:32
Date: Sun, 18 Oct 2026 16:32
57 lines
3392 bytes
3392 bytes
On Sun, 18 Oct 2026 18:11:18 +0200 Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote: > On 2026-10-18 17:26, Michael S wrote: > > On Sun, 18 Oct 2026 16:58:38 +0200 > > David Brown <david.brown@hesbynett.no> wrote: > >> On 18/10/2026 16:24, Michael S wrote: > [...] > >>> It would be interesting to find out why designers of C, or of one > >>> of its ancestors decided that * as prefix is preferable to * as > >>> postfix. > > Because it is more "natural" when read, easier to grasp? IMHO, no. >Simpler for compilers? 100% no. > More consistent if all other, especially standard > operators known from daily use are used in prefix-form (-5, +42, > !false, ~bitset) in expressions? Unary * is more similar in function to postfix operators like [] and () than to those you mentioned. > > I don't recall to have used any language with infix-expressions > that would have their monadic operators defined in postfix form. I am a Bear of Very Little Brain, and long words Bother Me. By chance, did you never use Pascal? > The only exception was "C" (and C-oriented languages) with their > special case of post-increment/post-decrement operators. (Think > also about the quirk in C++ to define monadic postfix operators > that require a syntactic dummy type argument). (In low-level RPN > systems it may appear more "natural", but that just aside.) > > >>> Were they afraid of confusion with usage of * as > >>> multiplication? Probably not, because confusion can arise about > >>> equally both for prefix and for postfix. > >> > >> I don't know why it is prefix. Maybe they were keen on "*p++ = > >> *q++" and similar expressions, felt "(p++)* = (q++)*" was unclear? > >> > > > > Why would it require parentheses? > > Not necessarily (I think). > > Janis >
Technical Details
Message-ID:
<20261018193201.00000b13@yahoo.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<119qf6l$2rmg3$1@dont-email.me> <11arjmc$2qid7$1@dont-email.me> <11at5vi$5vu$1@reader2.panix.com> <11auad0$3no1k$1@dont-email.me> <11aupfl$3ul$1@reader2.panix.com> <11avmfb$55rt$1@dont-email.me> <11b2a6d$131h6$1@dont-email.me> <20261018172446.00002d43@yahoo.com> <11b2mqu$16mof$3@dont-email.me> <20261018182627.00001934@yahoo.com> <11b2r36$3pvda$8@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Michael S <already5chosen@yahoo.com> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Sun, 18 Oct 2026 19:32:01 +0300 Organization: A noiseless patient Spider Lines: 57 Message-ID: <20261018193201.00000b13@yahoo.com> References: <119qf6l$2rmg3$1@dont-email.me> <11arjmc$2qid7$1@dont-email.me> <11at5vi$5vu$1@reader2.panix.com> <11auad0$3no1k$1@dont-email.me> <11aupfl$3ul$1@reader2.panix.com> <11avmfb$55rt$1@dont-email.me> <11b2a6d$131h6$1@dont-email.me> <20261018172446.00002d43@yahoo.com> <11b2mqu$16mof$3@dont-email.me> <20261018182627.00001934@yahoo.com> <11b2r36$3pvda$8@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Date: Sun, 18 Oct 2026 16:32:10 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1262206"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qYCKAds6e5mkhVxIcOSPJSzfkJ0RtOFs="; posting-host="f3ba9e4a06adc8c40e079351cfd7a0db" Cancel-Lock: sha1:TLqR90K35OZn2akn3Utmd3oyNK4= sha256:AAvxP387yPMCioaL6FMNTuMsbSyxJb2VDJDvXPq4RLs= sha1:3FH3vqSOubJ2a49daKyTXQCC2hk= sha256:32Qc1JzgHcTWDGzvyIK2SfmhZaK35omXTaVO/xlOyus= X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)