Article View: comp.lang.c
Article #548Re: Taming The Switch-Statement
From: Janis Papanagnou
Date: Mon, 19 Oct 2026 13:44
Date: Mon, 19 Oct 2026 13:44
65 lines
3832 bytes
3832 bytes
On 2026-10-18 18:32, Michael S wrote: > 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. Okay, if you think so. > >> Simpler for compilers? > > 100% no. I've read that would be a, albeit small, existing factor (when resolving ambiguities or some such; but I don't recall details). Anyway, I just want to mention some existing purported arguments, so I take your word as granted. > >> 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 know how you come to that opinion. Personally I've learned the concepts in abstract, non-language-specific forms as 'deref'; "deref p" not "p deref"; to me the former looks more natural, but we can agree that this may be just our personal preferences). (A less low-level language will ideally anyway abstract from any explicit dereferentiation, but since we're speaking about "C" I'm not expanding further on that.) > >> >> 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. (If that quote is important for your argument, please explain.) > > By chance, did you never use Pascal? Oh, yes, how could I forget that! (I stand corrected.) - I suppose it's because I considered that more an "accessor" than an operator (like the array or struct selectors); that's also why it's often not listed in Pascal's operator precedence tables. - So thanks for the reminder. Janis
Technical Details
Message-ID:
<11b56s8$1kr9u$2@dont-email.me>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> <20261018193201.00000b13@yahoo.com>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: Janis Papanagnou <janis_papanagnou+ng@hotmail.com> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Mon, 19 Oct 2026 15:44:40 +0200 Organization: A noiseless patient Spider Lines: 65 Message-ID: <11b56s8$1kr9u$2@dont-email.me> 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> <20261018193201.00000b13@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 19 Oct 2026 13:44:41 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1731902"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BDQ2HVtaCr/2lNDbuDC7J"; posting-host="9a1787de1638a6d9f83c958712c1b12a" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:uBNK/Tz/f0s9CxBbWUNqqDpbKeU= sha256:nP1SvJmVJpPDPHjy/bT3GTSW5UkwwnXrtVVtiWdqJ5M= sha1:7gIpFgNBZQfWJdVqUVneS61MUko= sha256:xNkLAdJxcjS2KzEZ+q5je3JS1kPDJAywvZDVzJnSieM= Content-Language: en-US In-Reply-To: <20261018193201.00000b13@yahoo.com>