Article View: comp.lang.c
Article #609Re: Taming The Switch-Statement
From: Janis Papanagnou
Date: Tue, 20 Oct 2026 14:56
Date: Tue, 20 Oct 2026 14:56
155 lines
8366 bytes
8366 bytes
On 2026-10-20 10:25, David Brown wrote:
> On 19/10/2026 23:27, Janis Papanagnou wrote:
>> On 2026-10-19 21:35, Michael S wrote:
>>> [...]
>>
>> I'm sorry, these are (AFAICT) common terms, and I thought obvious.
>
> I am afraid your terminology is further from common use than you
> thought.
I'm afraid you are wrong here; in several ways. I'll expand below.
> ("Common use" of course depends on the context of the user -
> we are in the context of C programmers.) Your posts can be clearer if
> you use appropriate terminology.
>
>
>> So let me explain and amend with more text and examples...
>>
>> Point 1. - I gave the hint that in languages that support RPN
>> (= Reverse Polish Notation) things like monadic postfix operators
>> (= having just _one_ argument applied _after_ the operator) are the
>> natural way of writing expressions. Less so in languages, which are
>> the majority since decades, that support expressions with infix
>> operators (= the operator arguments left and right of the operator).
>>
>
> RPN - Reverse Polish Notation - is certainly a well-known term, though
> the abbreviation might seem out of place.
I don't know why you think it would be "out of place". Since I gave
an explanation that made use of that concept I named it, and since
Michael had expressed difficulties with some of my (what I thought
to be commonly known, even here) terms I presented "RPN" with its
explicit meaning as you see above. (It's IMO good style to "explain"
acronyms when first used; but sadly - especially also here! - we
rarely see that, so I find it strange that you mention that at all.)
> "Postfix" is the term most
> obvious in the context of C, as that is the term used in the standards.
It's not about being obvious in context of C, it's about accuracy
of the used term in the context of my conceptual explanations.
(If I'd intended to explain something concerning the C-definition I
probably might have used the C-standard term. But I was explaining
something principle and used standard and common CS terminology.)
>
> And while "x y +" is clearly RPN, "x *" is not - it could be part of an
> infix expression, or a unary postfix operator.
Sure. If you reinspect my post you'll see that I used that term in
context of "x y +" and not in context of "a * b * ..." that I used
later. So your comment here is just unnecessary noise and void.
>
> "Monadic" /can/ refer to single argument functions or operators.
In CS I learned that "monadic" very specifically has the meaning I
used it for. - /Britannica/ (for example) [also] explains:
"Monadic and dyadic operators refer to the number of arguments
or operands an operator takes"
As an intermediate _general_ note; please accept that I use common
CS terms if I'm speaking about programming languages in general and
about design concepts. - I know and acknowledge that such terms are
often redefined (for specific contexts) or regularly misused. Don't
expect me to deliberately blur my language to express something for
an audience that *might* not have knowledge beyond "C". (I'd think
most of the audience here knows the CS terminology, though. If not
then I'll be glad to explain.)
> But it
> can also mean something completely different - monadic operations are
> operations that work on "packaged" types that unpack the value, apply a
> function, and pack it in again. There is nothing of that kind in C (the
> language or standard library), but it is becoming a familiar term for
> users of C++ and is well-established in many other languages.
(I know "many other languages" but don't recall to have seen mentioned
that word in another language with a meaning other than explained. So
I cannot know that it was given another meaning in some other special
area (like "packed types"). But I'd also expect that IT people at least
know the common CS terms.)
>
> The C standard using "unary" for single-argument operators.
>
> Similarly, "binary" is the normal term for two-argument operators, not
> "dyadic". (Though I don't think "dyadic" has any other common meanings.)
If we compare in discussions monadic and dyadic operators it would be
more a terminology issue with "unary" since the counterpart would then
be "binary", and "binary" is a homonymous word in that area and also on
that explanation level. - I prefer a most fitting choice of words.
And I'm sorry if some cannot follow my post because of that. But I'm
willing to explain if some terms are not known to some here; just ask.
>
>> Point 2. - A "binary operator" may be the '*' in the expressions
>> a * b typical infix notation (with parenthesis for precedence)
>> a b * RPN
>
> Normally known as "postfix", especially in C.
"Normally" I've seen that notation called RPN sometimes also as postfix
notation. (Please don't try to teach a duck swimming. And I suggest to
not join the club of folks who generalize based on opinions with words
like "normally".)
>
>> * a b PN (Polish Notation)
>
> There is no term "Polish Notation" -
My academic education as well as some [well reputed] online resources
disagree with you. (I wonder why you didn't check your _opinion_ here!)
> except as occasionally used to
> mean /postfix/ as a short form of "Reverse Polish Notation". RPN was
> invented, or at least popularised, by the Polish logician Jan
> Łukasiewicz (I admit to looking that up on Wikipedia!). There is no
> "PN" opposite.
Oh, so you have just missed it! - Retry...
https://en.wikipedia.org/wiki/Polish_notation
And next time better stay quiet instead of trying to play the smartass
without need! (It's really not necessary to post as much as you do.)
>
>>
>> A "binary operator" is something different from an "infix expression"
>> (the first one of the three; the others are RPN and PN examples).
>> That's why I took the appropriate term to explain what I intended to
>> explain.
>
> Yes, binary operators can be prefix, infix or postfix.
You don't need to confirm that. (It's common knowledge.)
> [ snip rest ]
(I've got tired and bored about your post.) :-/
But thanks for making it obvious that I cannot expect common and long
existing CS terms to be generally understood here.
I admit, that I might have made a wrong assumption about CS knowledge
here; before your post I thought it were just one or two individuals.
(Now my guess would be that it could be three or four individuals.)
Janis
Technical Details
Message-ID:
<11b7vev$1l24u$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> <11b56s8$1kr9u$2@dont-email.me> <20261019223538.00006521@yahoo.com> <11b61v8$1kr9u$6@dont-email.me> <11b78i5$2m8c9$4@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: Janis Papanagnou <janis_papanagnou+ng@hotmail.com> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Tue, 20 Oct 2026 16:56:31 +0200 Organization: A noiseless patient Spider Lines: 155 Message-ID: <11b7vev$1l24u$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> <11b56s8$1kr9u$2@dont-email.me> <20261019223538.00006521@yahoo.com> <11b61v8$1kr9u$6@dont-email.me> <11b78i5$2m8c9$4@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Tue, 20 Oct 2026 14:56:32 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1738910"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bqhWuQxg3kBOFIeZ878W4"; posting-host="98d152822712807c6006cdf81de10da1" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:6U2LHjKBsGlW6Edvp5hFnfp81BM= sha256:me1j2TYmYUvWZDRK5WgcJLtN1Ym/qG0SXL6dusrAHus= sha1:PghM5rDuO+h4gJPTA18h+KpKDNY= sha256:xcZB26EnWLkoEJs78YMhc0X+IFbbPJ690gRztk/aPlQ= In-Reply-To: <11b78i5$2m8c9$4@dont-email.me> Content-Language: en-US