🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

162 total messages Page 2 of 4 Started by Lynn McGuire Thu, 05 Nov 2026 23:42
Page 2 of 4 • 162 total messages
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1408
Author: David Brown
Date: Tue, 10 Nov 2026 09:32
16 lines
1760 bytes
On 10/11/2026 09:58, Fred. Zwarts wrote:
> Op 09.nov.2026 om 10:03 schreef Bonita Montero:
>> Am 06.11.2026 um 00:42 schrieb Lynn McGuire:
>>
>>> if (j1 * i1 < 1) {
>>>      goto L463;
>>> }
>>> ...
>>> if ((j1 * i1) < 1) {
>>>      goto L463;
>>> }
>> The latter one leads to more optimized code !
> 
> Really? Why?

I /presume/ Bonita was joking.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1433
Author: James Kuyper
Date: Tue, 10 Nov 2026 15:45
18 lines
2453 bytes
On 2026-11-09 15:42, Janis Papanagnou wrote:
> On 2026-11-09 12:00, James Kuyper wrote:
...>> I tend not to use unnecessary parentheses, and I know the grammar well
>> enough to correctly identify them - but many people don't know the
>> grammar that well, which might include the next person to maintain my
>> code. There are reasonable arguments that I should use parentheses more
>> than I actually do, for the benefit of such people.
> 
> I'm "a bit" unsettled by the idea of a programmer who is unfamiliar
> with the language in general or the grammar specifically! (I know
> there's such folks writing programs.) I wouldn't write programs in
> ways to satisfy such folks. I'd certainly write programs in ways to
> keep the program maintainable focusing on the language specifics not
> imagining that the piece of code might be handled by a Neanderthal.

I've worked with a lot of entry-level programmers in my career. Some of
them had Ph.Ds in science, but were novices to programming. That
probably influenced my expectations.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1438
Author: Bonita Montero
Date: Tue, 10 Nov 2026 16:41
16 lines
1847 bytes
Am 10.11.2026 um 09:58 schrieb Fred. Zwarts:
> Op 09.nov.2026 om 10:03 schreef Bonita Montero:
>> Am 06.11.2026 um 00:42 schrieb Lynn McGuire:
>>
>>> if (j1 * i1 < 1) {
>>>      goto L463;
>>> }
>>> ...
>>> if ((j1 * i1) < 1) {
>>>      goto L463;
>>> }
>> The latter one leads to more optimized code !
> 
> Really? Why?

It's faster the more braces you have.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1447
Author: Lynn McGuire
Date: Tue, 10 Nov 2026 20:48
54 lines
3848 bytes
On 11/10/2026 12:25 AM, Chris M. Thomasson wrote:
> On 11/9/2026 8:39 PM, Lynn McGuire wrote:
>> On 11/9/2026 6:54 PM, Keith Thompson wrote:
>>> Lawrence D’Oliveiro <ldo@nz.invalid> writes:
>>>> On Mon, 9 Nov 2026 06:00:40 -0500, James Kuyper wrote:
>>>>> I tend not to use unnecessary parentheses, and I know the grammar
>>>>> well enough to correctly identify them - but many people don't know
>>>>> the grammar that well, which might include the next person to
>>>>> maintain my code.
>>>>
>>>> Even if they haven’t committed the precedence table to memory, surely
>>>> they have the ability to look things up online
>>>> <https://en.cppreference.com/c/language/operator_precedence>.
>>>>
>>>> If someone has regular trouble with certain language features, why
>>>> aren’t pages that clarify those very issues not already in their
>>>> browser bookmarks?
>>>
>>> If I haven't memorized all the precedence levels, I greatly prefer
>>> an expression I can read at a glance to one that requires me to
>>> consult some document before I can be sure what it means, just so
>>> I can continue to the next line of code.
>>>
>>> Just one example: I couldn't tell you whether `^` or `|` binds more
>>> tightly without looking it up.  If you can, that's great.
>>>
>>> Preferences for *how many* strictly semantically unnecessary
>>> parentheses are appropriate vary greatly, but few C programmers
>>> would insist on none.
>>
>> I ship my software written in four different software languages.  C++, 
>> Fortran, Visual Basic, and C#.  Remembering the nuances of each is 
>> tricky.  I find it best to be safe.
>>
>> I have shipped software in about a dozen software languages in my 51 
>> year career.  C++, Fortran IV (66), Fortran 77, Visual Basic, 
> 
> VB 6? Do you use access as well?
> 
>> C#, Turbo Pascal, Basic, Turbo C, Unix C, IBM 370 Assembler, Intel x86 
>> Assembler, AWK.  I think that I am leaving out a couple that I cannot 
>> remember at the moment.
>>
>> Lynn

Nope.  It is just a sample app with source code to show how to connect 
to my DLLs using VB.  I have several samples apps including an Excel 
spreadsheet.  I have never used Access.

All of my calculation software is currently Win32 DLLs so my customers 
can easily use them for custom calculations.

Lynn
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1449
Author: Chris M. Thomasson
Date: Tue, 10 Nov 2026 21:12
69 lines
4544 bytes
On 11/10/2026 12:48 PM, Lynn McGuire wrote:
> On 11/10/2026 12:25 AM, Chris M. Thomasson wrote:
>> On 11/9/2026 8:39 PM, Lynn McGuire wrote:
>>> On 11/9/2026 6:54 PM, Keith Thompson wrote:
>>>> Lawrence D’Oliveiro <ldo@nz.invalid> writes:
>>>>> On Mon, 9 Nov 2026 06:00:40 -0500, James Kuyper wrote:
>>>>>> I tend not to use unnecessary parentheses, and I know the grammar
>>>>>> well enough to correctly identify them - but many people don't know
>>>>>> the grammar that well, which might include the next person to
>>>>>> maintain my code.
>>>>>
>>>>> Even if they haven’t committed the precedence table to memory, surely
>>>>> they have the ability to look things up online
>>>>> <https://en.cppreference.com/c/language/operator_precedence>.
>>>>>
>>>>> If someone has regular trouble with certain language features, why
>>>>> aren’t pages that clarify those very issues not already in their
>>>>> browser bookmarks?
>>>>
>>>> If I haven't memorized all the precedence levels, I greatly prefer
>>>> an expression I can read at a glance to one that requires me to
>>>> consult some document before I can be sure what it means, just so
>>>> I can continue to the next line of code.
>>>>
>>>> Just one example: I couldn't tell you whether `^` or `|` binds more
>>>> tightly without looking it up.  If you can, that's great.
>>>>
>>>> Preferences for *how many* strictly semantically unnecessary
>>>> parentheses are appropriate vary greatly, but few C programmers
>>>> would insist on none.
>>>
>>> I ship my software written in four different software languages.  C+ 
>>> +, Fortran, Visual Basic, and C#.  Remembering the nuances of each is 
>>> tricky.  I find it best to be safe.
>>>
>>> I have shipped software in about a dozen software languages in my 51 
>>> year career.  C++, Fortran IV (66), Fortran 77, Visual Basic, 
>>
>> VB 6? Do you use access as well?
>>
>>> C#, Turbo Pascal, Basic, Turbo C, Unix C, IBM 370 Assembler, Intel 
>>> x86 Assembler, AWK.  I think that I am leaving out a couple that I 
>>> cannot remember at the moment.
>>>
>>> Lynn
> 
> Nope.  It is just a sample app with source code to show how to connect 
> to my DLLs using VB.  

That's fine. Fwiw, I wrote a full blown specialized whole home/pool 
inspection system using VB 6, Access and Word 6 for my Dad way back in 
the day. What service pack are you using? Those were fun... ahh, back in 
the day... ;^o


> I have several samples apps including an Excel 
> spreadsheet.  I have never used Access.

Actually, Access worked pretty damn good for my needs. Then, iirc, it 
got superseded by SQL server.


> All of my calculation software is currently Win32 DLLs so my customers 
> can easily use them for custom calculations.

Well, that should work fine. Once they know the API, anybody should be 
able to use them. Iirc, it was a little strange to map DLL's created in 
C to the VB 6 data types. But, can be done for sure.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1450
Author: Lynn McGuire
Date: Tue, 10 Nov 2026 21:21
74 lines
4721 bytes
On 11/10/2026 3:12 PM, Chris M. Thomasson wrote:
> On 11/10/2026 12:48 PM, Lynn McGuire wrote:
>> On 11/10/2026 12:25 AM, Chris M. Thomasson wrote:
>>> On 11/9/2026 8:39 PM, Lynn McGuire wrote:
>>>> On 11/9/2026 6:54 PM, Keith Thompson wrote:
>>>>> Lawrence D’Oliveiro <ldo@nz.invalid> writes:
>>>>>> On Mon, 9 Nov 2026 06:00:40 -0500, James Kuyper wrote:
>>>>>>> I tend not to use unnecessary parentheses, and I know the grammar
>>>>>>> well enough to correctly identify them - but many people don't know
>>>>>>> the grammar that well, which might include the next person to
>>>>>>> maintain my code.
>>>>>>
>>>>>> Even if they haven’t committed the precedence table to memory, surely
>>>>>> they have the ability to look things up online
>>>>>> <https://en.cppreference.com/c/language/operator_precedence>.
>>>>>>
>>>>>> If someone has regular trouble with certain language features, why
>>>>>> aren’t pages that clarify those very issues not already in their
>>>>>> browser bookmarks?
>>>>>
>>>>> If I haven't memorized all the precedence levels, I greatly prefer
>>>>> an expression I can read at a glance to one that requires me to
>>>>> consult some document before I can be sure what it means, just so
>>>>> I can continue to the next line of code.
>>>>>
>>>>> Just one example: I couldn't tell you whether `^` or `|` binds more
>>>>> tightly without looking it up.  If you can, that's great.
>>>>>
>>>>> Preferences for *how many* strictly semantically unnecessary
>>>>> parentheses are appropriate vary greatly, but few C programmers
>>>>> would insist on none.
>>>>
>>>> I ship my software written in four different software languages.  C+ 
>>>> +, Fortran, Visual Basic, and C#.  Remembering the nuances of each 
>>>> is tricky.  I find it best to be safe.
>>>>
>>>> I have shipped software in about a dozen software languages in my 51 
>>>> year career.  C++, Fortran IV (66), Fortran 77, Visual Basic, 
>>>
>>> VB 6? Do you use access as well?
>>>
>>>> C#, Turbo Pascal, Basic, Turbo C, Unix C, IBM 370 Assembler, Intel 
>>>> x86 Assembler, AWK.  I think that I am leaving out a couple that I 
>>>> cannot remember at the moment.
>>>>
>>>> Lynn
>>
>> Nope.  It is just a sample app with source code to show how to connect 
>> to my DLLs using VB. 
> 
> That's fine. Fwiw, I wrote a full blown specialized whole home/pool 
> inspection system using VB 6, Access and Word 6 for my Dad way back in 
> the day. What service pack are you using? Those were fun... ahh, back in 
> the day... ;^o
> 
> 
>> I have several samples apps including an Excel spreadsheet.  I have 
>> never used Access.
> 
> Actually, Access worked pretty damn good for my needs. Then, iirc, it 
> got superseded by SQL server.
> 
> 
>> All of my calculation software is currently Win32 DLLs so my customers 
>> can easily use them for custom calculations.
> 
> Well, that should work fine. Once they know the API, anybody should be 
> able to use them. Iirc, it was a little strange to map DLL's created in 
> C to the VB 6 data types. But, can be done for sure.

VB6 SP5 IIRC.

Lynn
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1451
Author: Chris M. Thomasson
Date: Tue, 10 Nov 2026 21:23
19 lines
1985 bytes
On 11/10/2026 8:41 AM, Bonita Montero wrote:
> Am 10.11.2026 um 09:58 schrieb Fred. Zwarts:
>> Op 09.nov.2026 om 10:03 schreef Bonita Montero:
>>> Am 06.11.2026 um 00:42 schrieb Lynn McGuire:
>>>
>>>> if (j1 * i1 < 1) {
>>>>      goto L463;
>>>> }
>>>> ...
>>>> if ((j1 * i1) < 1) {
>>>>      goto L463;
>>>> }
>>> The latter one leads to more optimized code !
>>
>> Really? Why?
> 
> It's faster the more braces you have.

You mean taking pressure off of the compiler stages, or what?
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1454
Author: Janis Papanagnou
Date: Wed, 11 Nov 2026 07:38
29 lines
2396 bytes
On 2026-11-10 22:23, Chris M. Thomasson wrote:
> On 11/10/2026 8:41 AM, Bonita Montero wrote:
>> Am 10.11.2026 um 09:58 schrieb Fred. Zwarts:
>>> Op 09.nov.2026 om 10:03 schreef Bonita Montero:
>>>> Am 06.11.2026 um 00:42 schrieb Lynn McGuire:
>>>>
>>>>> if (j1 * i1 < 1) {
>>>>>      goto L463;
>>>>> }
>>>>> ...
>>>>> if ((j1 * i1) < 1) {
>>>>>      goto L463;
>>>>> }
>>>> The latter one leads to more optimized code !
>>>
>>> Really? Why?
>>
>> It's faster the more braces you have.
> 
> You mean taking pressure off of the compiler stages, or what?

It's actually depending on the quotient of parenthesis and braces,
just to be clear. If the number of braces is f(i) and the number
of parenthesis is f(i+1), where 'f' is the Fibonacci function,
the compiler will be able to create faster code, whereas if these
numbers are swapped it will create slower code. (Obviously, no?)

Janis
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1455
Author: Bonita Montero
Date: Wed, 11 Nov 2026 10:11
8 lines
1986 bytes
Am 11.11.2026 um 08:38 schrieb Janis Papanagnou:

> It's actually depending on the quotient of parenthesis and braces,
> just to be clear. If the number of braces is f(i) and the number
> of parenthesis is f(i+1), where 'f' is the Fibonacci function,
> the compiler will be able to create faster code, whereas if these
> numbers are swapped it will create slower code. (Obviously, no?)
Great !
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1490
Author: Tristan Wibberley
Date: Thu, 12 Nov 2026 19:44
53 lines
3654 bytes
On 06/11/2026 01:12, Lawrence D’Oliveiro wrote:
> On Thu, 5 Nov 2026 19:52:31 -0500, James Kuyper wrote:
> 
>> For historical reasons, bitwise or (|) and bitwise and (&) are
>> exceptions. Unfortunately, correcting that mistake would break
>> backwards compatibility ...
> 
> The only real issue is that bitwise ops have lower priority than
> comparisons, when they should be higher. If they were higher, then an
> expression like
> 
>     (bitval & mask) == desired_value



> wouldn’t need parentheses.
> 
> Realistically, can anyone offer *any* real-world C code that
> uses an expression that would be parenthesized like
> 
>     a & (b == c)

bitwise ops are well used to do logic on 'booleans' without increasing
cyclomatic complexity which is very important for safety critical
procedures, as long as you are very regular with how you evaluate
expressions that produce them (I used it in very regular ways having
decided it was okay but I here qualify myself in case some strange
comparisons are not defined to evaluate to either 1 or 0 - "!!" can
often and perhaps always be used).

Both rhs and lhs are evaluated on each evaluation of the whole when '&'
is used, but not when '&&' is used.

I usually add parentheses anyway to these kinds of expressions, or
better yet define a const register local object (which is often easier
to follow in a debugger and to reference an intermediate result in
extrinsic analysis). Helping the reader to know superficially what the
meaning of such expression is lets them put more time elsewhere to
achieve a purpose correctly.


-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1498
Author: Tristan Wibberley
Date: Thu, 12 Nov 2026 22:27
42 lines
3029 bytes
On 12/11/2026 19:44, Tristan Wibberley wrote:
> On 06/11/2026 01:12, Lawrence D’Oliveiro wrote:
>> On Thu, 5 Nov 2026 19:52:31 -0500, James Kuyper wrote:
>>
>>> For historical reasons, bitwise or (|) and bitwise and (&) are
>>> exceptions. Unfortunately, correcting that mistake would break
>>> backwards compatibility ...
>>
>> The only real issue is that bitwise ops have lower priority than
>> comparisons, when they should be higher. If they were higher, then an
>> expression like
>>
>>     (bitval & mask) == desired_value
> 
> 
> 
>> wouldn’t need parentheses.
>>
>> Realistically, can anyone offer *any* real-world C code that
>> uses an expression that would be parenthesized like
>>
>>     a & (b == c)
> 
> bitwise ops are well used to do logic on 'booleans'

oh yeah, for C this is all "int" so I think I would only want to do it
with 2s-complement architectures. I think C++ is fine because they're
"bool" instead.


-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1504
Author: David Brown
Date: Fri, 13 Nov 2026 08:41
97 lines
6111 bytes
On 12/11/2026 23:27, Tristan Wibberley wrote:
> On 12/11/2026 19:44, Tristan Wibberley wrote:
>> On 06/11/2026 01:12, Lawrence D’Oliveiro wrote:
>>> On Thu, 5 Nov 2026 19:52:31 -0500, James Kuyper wrote:
>>>
>>>> For historical reasons, bitwise or (|) and bitwise and (&) are
>>>> exceptions. Unfortunately, correcting that mistake would break
>>>> backwards compatibility ...
>>>
>>> The only real issue is that bitwise ops have lower priority than
>>> comparisons, when they should be higher. If they were higher, then an
>>> expression like
>>>
>>>      (bitval & mask) == desired_value
>>
>>
>>
>>> wouldn’t need parentheses.
>>>
>>> Realistically, can anyone offer *any* real-world C code that
>>> uses an expression that would be parenthesized like
>>>
>>>      a & (b == c)
>>
>> bitwise ops are well used to do logic on 'booleans'
> 
> oh yeah, for C this is all "int" so I think I would only want to do it
> with 2s-complement architectures. I think C++ is fine because they're
> "bool" instead.
> 
> 

In C, the equality and relational operators evaluate to an "int" value 
of either 0 or 1.  They never result in any other value.  In C++, the 
type of the evaluation is "bool", but the value is identical.  Given 
that there are (in both languages) implicit conversions between bool and 
int and back again that will not affect these values at all, there is no 
practical difference unless you are using the type directly (for sizeof, 
_Generic, type inference, _Alignof).

(Conversion to bool is done by comparing the value to 0.  So any int 
value other than 0 gets converted to "true", while 0 gets converted to 
"false".  Two logical negations - !!x - is sometimes used as a kind of 
"normalisation" operator that in C changes a non-zero scalar value - 
including non-null pointers - to an int of value 1, and changes a zero 
scalar value - including a null pointer - into an int of value 0.  It is 
superfluous if "x" is the result of an equality or relational operator, 
since those already evaluate to 0 or 1.)

When applied to values that are either 0 or 1, the bitwise operators & 
and | will give the same results as the logical operators && and ||.

The bitwise operators will always result in code that acts as if it 
evaluates the right-hand side of the expression.  The logical operators 
result in code that acts as if it evaluates the right-hand side if and 
only if the evaluation of the left-hand side does not determine the 
final evaluation.

Note the "acts as if".  If you write "if ((x > 2) && (x < 10))", the 
generated code will almost certainly be the same as if you used bitwise 
&, and both sub-expressions will be evaluated - because that is more 
efficient than using a conditional branch.  The only time an optimising 
compiler actually follows the rules about what is and what is not 
evaluated, is when there are side-effects that could potentially lead to 
observable behaviour.  Outside of that, the compiler will generate what 
it thinks is the most efficient result.

The most sensible way to write your code - IMHO - is to use bitwise 
operators only when you actually mean bitwise operations such as 
masking.  Use logical operators when you mean logical operations - "this 
is true AND that is true" or "this is true OR that is true".  And of 
course, use logical operators if you need to rely on the short-circuit 
evaluation or order of evaluation.


In terms of style, for complex expressions you should always use 
parentheses and/or split up the expression into parts assigned to local 
variables, according to what you think gives the clearest and most 
maintainable code that fits with any coding style requirements you have 
for the project, and perhaps with consideration for ease of debugging 
tools if that is relevant.  Optimising compilers are likely to generate 
identical code regardless of how you split things up.  There is nothing 
special about logical or bitwise operators here.

And don't bother with the "register" keyword.  Optimising compilers have 
ignored that for decades, and C++ removed it in C++17 (while preserving 
it as a keyword for future usage).


None of this has any connection to the representation of signed 
integers, or whether that is two's complement or otherwise.  No known 
modern C compilers (i.e., anything beyond perhaps C99) use anything 
other than two's complement - no known C++ compilers have ever supported 
anything else.  Signed integer representation is always two's complement 
since C23 and C++20.

Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1517
Author: Waldek Hebisch
Date: Fri, 13 Nov 2026 14:47
31 lines
2471 bytes
In comp.lang.c Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
> On 2026-11-09 21:24, Lynn McGuire wrote:
>> On 11/8/2026 2:55 AM, Janis Papanagnou wrote:
>>> On 2026-11-08 02:13, Lynn McGuire wrote:
>>>> On 11/7/2026 6:30 PM, Janis Papanagnou wrote:
>>>>> [...]  I'm still traumatized by the code
>>>>> that I had tried to de-goto-fy not long ago.
>>>>
>>>> At least I do not have any "come from"s in my code.
>>>
>>> :-)
>>>
>>> I suppose you have Intercal in mind? ;-)
>> 
>> Fortran of course.
>>     https://en.wikipedia.org/wiki/COMEFROM
> 
> Jesus!  8-o
> 
> Interesting article; I didn't know that "joke" was
> considered also by those more serious languages.

It is unfortunate that joke made people overlook potentially
quite useful instruction.  Let me add that I mean instruction
at assembly/machine level (that is why I do not elaborate here,
as this has nothing to do with C).  In higher level languages it
probably would interfere too much with semantics of other
constructs to make sense.

-- 
                              Waldek Hebisch
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1518
Author: Tristan Wibberley
Date: Fri, 13 Nov 2026 15:27
112 lines
6486 bytes
On 13/11/2026 08:41, David Brown wrote:
> On 12/11/2026 23:27, Tristan Wibberley wrote:
>> On 12/11/2026 19:44, Tristan Wibberley wrote:
>>> On 06/11/2026 01:12, Lawrence D’Oliveiro wrote:
>>>> On Thu, 5 Nov 2026 19:52:31 -0500, James Kuyper wrote:
>>>>
>>>>> For historical reasons, bitwise or (|) and bitwise and (&) are
>>>>> exceptions. Unfortunately, correcting that mistake would break
>>>>> backwards compatibility ...
>>>>
>>>> The only real issue is that bitwise ops have lower priority than
>>>> comparisons, when they should be higher. If they were higher, then an
>>>> expression like
>>>>
>>>>      (bitval & mask) == desired_value
>>>
>>>
>>>
>>>> wouldn’t need parentheses.
>>>>
>>>> Realistically, can anyone offer *any* real-world C code that
>>>> uses an expression that would be parenthesized like
>>>>
>>>>      a & (b == c)
>>>
>>> bitwise ops are well used to do logic on 'booleans'
>>
>> oh yeah, for C this is all "int" so I think I would only want to do it
>> with 2s-complement architectures. I think C++ is fine because they're
>> "bool" instead.
>>
>>
> 
> In C, the equality and relational operators evaluate to an "int" value
> of either 0 or 1.  They never result in any other value.

0 has two representations in 1s-complement, all zeros or all ones. I am
worried about that when using bitwise operators to implement logic in
case a comparison yields an all-ones representation of 0. Do comparisons
and ! always produce the all-zeros representation in 1s-complement machines?


> The only time an optimising
> compiler actually follows the rules about what is and what is not
> evaluated, is when there are side-effects that could potentially lead to
> observable behaviour.

For sufficiently restrictive definitions of "observable". Clocks and
voltage drops are observable. Voltage drops in particular can cause
explosives to land in the wrong place when other systems don't get the
current they need. If you can supply the current without dropping
voltage you still have more heat being produced. It all matters at the
extremes.


> The most sensible way to write your code - IMHO - is to use bitwise
> operators only when you actually mean bitwise operations such as
> masking.  Use logical operators when you mean logical operations - "this
> is true AND that is true" or "this is true OR that is true".  And of
> course, use logical operators if you need to rely on the short-circuit
> evaluation or order of evaluation.

Using shortcutting when you don't require shortcutting has a meaningful
effect on objective measures of the complexity of the system (as does
using an unspecified order with bitwise operators.

bitwise operators always evaluate both operands but in unspecified order.
logical operators sometimes evaluate only one operand but in specified
order when they evaluate both.

The types of failure that can be caused by that difference can matter.

Using the bitwise operators can cause usage of shared resources to vary
across the domain. Idempotency mitigates this and is advisable widely
anyway, so for techniques to avoid shared resources from existing
anyway. The integration solutions for such problems are some of the
intuitive ones relied on when integrating independent active systems
anyway (ie, we already think about systems in terms of "the two effects
happen, make sure your stuff works in case of whichever order"). One can
signal an effect threshold wrapping the logic in a trigger call and so
forth.

Using the logical operators can cause usage of private resources to vary
across the domain. It remains a problem even when other good practices
have been applied.

It's not perfect to use bitwise, clearly, but the alternative complexity
of a configuration (order vs shortcut) is sometimes an opportune
reduction in complexity of a development process or asset lifetime.


> And don't bother with the "register" keyword.  Optimising compilers have
> ignored that for decades, and C++ removed it in C++17 (while preserving
> it as a keyword for future usage).

It ought to have been kept meaningful in C++ to mask operator& at least.
I recall it was at least as early as C++98 that it was noneffective,
definitely I know it was before C++17 because I never used C++17.


-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1521
Author: David Brown
Date: Fri, 13 Nov 2026 16:49
224 lines
11085 bytes
On 13/11/2026 16:27, Tristan Wibberley wrote:
> On 13/11/2026 08:41, David Brown wrote:
>> On 12/11/2026 23:27, Tristan Wibberley wrote:
>>> On 12/11/2026 19:44, Tristan Wibberley wrote:
>>>> On 06/11/2026 01:12, Lawrence D’Oliveiro wrote:
>>>>> On Thu, 5 Nov 2026 19:52:31 -0500, James Kuyper wrote:
>>>>>
>>>>>> For historical reasons, bitwise or (|) and bitwise and (&) are
>>>>>> exceptions. Unfortunately, correcting that mistake would break
>>>>>> backwards compatibility ...
>>>>>
>>>>> The only real issue is that bitwise ops have lower priority than
>>>>> comparisons, when they should be higher. If they were higher, then an
>>>>> expression like
>>>>>
>>>>>       (bitval & mask) == desired_value
>>>>
>>>>
>>>>
>>>>> wouldn’t need parentheses.
>>>>>
>>>>> Realistically, can anyone offer *any* real-world C code that
>>>>> uses an expression that would be parenthesized like
>>>>>
>>>>>       a & (b == c)
>>>>
>>>> bitwise ops are well used to do logic on 'booleans'
>>>
>>> oh yeah, for C this is all "int" so I think I would only want to do it
>>> with 2s-complement architectures. I think C++ is fine because they're
>>> "bool" instead.
>>>
>>>
>>
>> In C, the equality and relational operators evaluate to an "int" value
>> of either 0 or 1.  They never result in any other value.
> 
> 0 has two representations in 1s-complement, all zeros or all ones. I am
> worried about that when using bitwise operators to implement logic in
> case a comparison yields an all-ones representation of 0. Do comparisons
> and ! always produce the all-zeros representation in 1s-complement machines?
> 

In C implementations using ones' complement, the two representations of 
integer value 0 (if all one bits is considered a value rather than a 
trap representation) always compare equal.  There are only a few 
operations that can potentially produce a negative zero, and the 
relational operators are not amongst those.  Bitwise operators /can/ 
produce a negative zero, but you would have to start off with negative 
numbers to get them - an expression mixing relational operators and 
bitwise operators (other than bitwise negation) cannot produce anything 
other than 0 or 1.

And there are no C implementations that are not two's complement, other 
than a few ancient compilers for museum mainframes.  You can be entirely 
confident that your code will never be used on them.

But as I said before, if you are writing a logical expression, use the 
logical operators.  There is no benefit in using bitwise operators when 
the logical operators are appropriate - unless you count "confusing 
readers" as a benefit.

> 
>> The only time an optimising
>> compiler actually follows the rules about what is and what is not
>> evaluated, is when there are side-effects that could potentially lead to
>> observable behaviour.
> 
> For sufficiently restrictive definitions of "observable".

The C standards define "observable behaviour", and that is the 
definition I use.

> Clocks and
> voltage drops are observable. Voltage drops in particular can cause
> explosives to land in the wrong place when other systems don't get the
> current they need. If you can supply the current without dropping
> voltage you still have more heat being produced. It all matters at the
> extremes.

Lots of things matter in real-world programming other than "observable 
behaviour" in C code.  But it is only the C standards definition of 
"observable behaviour" that matters for the semantics of the C code, or 
how the compiler looks at it.  When choosing whether or not to evaluate 
the right-hand side of an operator expression, the compiler cares about 
what the C standards say - not any non-C effects.  And if the compiler 
can see that it has a choice in how to generate the code, it will pick 
based on flags for speed optimisation, size optimisation, debugging, etc.

> 
> 
>> The most sensible way to write your code - IMHO - is to use bitwise
>> operators only when you actually mean bitwise operations such as
>> masking.  Use logical operators when you mean logical operations - "this
>> is true AND that is true" or "this is true OR that is true".  And of
>> course, use logical operators if you need to rely on the short-circuit
>> evaluation or order of evaluation.
> 
> Using shortcutting when you don't require shortcutting has a meaningful
> effect on objective measures of the complexity of the system (as does
> using an unspecified order with bitwise operators.

What meaningful effect?  The evaluation of an expression that does not 
affect C observable behaviour has /zero/ "meaningful effect" in C.

First understand the C semantics - what the C code means, and what the 
"as if" rule means.  That's how you can understand what "correctness" 
means in C programming.  C has no concept of speed, or code size, or 
suchlike.  Only once you have got that under control can you start 
looking at non-C attributes, like code speed.  The speed of code can of 
course be a vital element in the usefulness of a program for a given 
task, but it is pointless to worry about speed until you know what is 
correct or not.  Fast but wrong is no use to anyone.

> 
> bitwise operators always evaluate both operands but in unspecified order.

Correct.

> logical operators sometimes evaluate only one operand but in specified
> order when they evaluate both.

Correct.

But do you understand what "evaluates" means here?

Look at the generated code for simple test code :

<https://godbolt.org/z/9Wxsheqhd>

int test1(int x) {
	return (x > 2) && (x < 10);
}

int test2(int x) {
	return (x > 2) & (x < 10);
}


It test1, the semantics of C require that the generated code acts /as 
if/ the second test "x < 10" is evaluated if and only if the first test 
"x > 2" passes.  And yet the compiler generates identical code for both 
test1 and test2.  It does this because evaluating "x < 10" has no 
side-effects, and the most efficient results are produced by doing that 
calculation every time.

> 
> The types of failure that can be caused by that difference can matter.

Do you have an example in mind?  That might make it easier to understand 
what you are talking about.


> 
> Using the bitwise operators can cause usage of shared resources to vary
> across the domain. 

I have no idea what you mean by this.

> Idempotency mitigates this and is advisable widely
> anyway, so for techniques to avoid shared resources from existing
> anyway.

I have no idea what you mean by this.  You might be using the word 
"idempotency" incorrectly.  (An operation "op" is "idempotent" if and 
only if "x op x == x" for all "x".)

> The integration solutions for such problems are some of the
> intuitive ones relied on when integrating independent active systems
> anyway (ie, we already think about systems in terms of "the two effects
> happen, make sure your stuff works in case of whichever order"). 

Are you trying to say that since the order of evaluation of the 
sub-expressions for most operators (including the bitwise ones) is not 
specified, your code should not rely on any specific ordering?  That is 
obviously true.

> One can
> signal an effect threshold wrapping the logic in a trigger call and so
> forth.

Again, I have no idea what you are trying to say here.


> 
> Using the logical operators can cause usage of private resources to vary
> across the domain. It remains a problem even when other good practices
> have been applied.

You are going to have to give examples or explain better.  The only 
thing I can think of is for cryptography applications where you want to 
be sure that timings, processor power usage, and other related factors 
are independent of the values being used.  To give a simplistic example, 
you don't want to have a password check algorithm that returns a failure 
as soon as it hits a mismatched character - then an attacker could use 
that information to know which character was incorrect.  In general, C 
has no way to express things like constant timings - cryptographic 
algorithms that need that cannot be written in standard C.

> 
> It's not perfect to use bitwise, clearly, but the alternative complexity
> of a configuration (order vs shortcut) is sometimes an opportune
> reduction in complexity of a development process or asset lifetime.
> 
> 
>> And don't bother with the "register" keyword.  Optimising compilers have
>> ignored that for decades, and C++ removed it in C++17 (while preserving
>> it as a keyword for future usage).
> 
> It ought to have been kept meaningful in C++ to mask operator& at least.
> I recall it was at least as early as C++98 that it was noneffective,
> definitely I know it was before C++17 because I never used C++17.
> 

Prior to C++17, the "register" keyword had the same meaning in C++ as it 
does in C.  It is a storage-class specified.  The only semantic effect 
of declaring an object with "register" is that it is a constraint 
violation to apply the & operator to it - i.e., you cannot take its 
address.  It may be seen as a hint to the compiler that the variable 
should be optimised for speed - but optimising compilers have ignored 
that for decades, since they optimise /everything/.  It may have some 
small influence on some compilers if you do not use optimisation, but it 
is meaningless to be concerned about the speed of code when not optimising.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1523
Author: Keith Thompson
Date: Fri, 13 Nov 2026 19:46
55 lines
3604 bytes
Tristan Wibberley <tristan.wibberley+netnews2@alumni.manchester.ac.uk>
writes:
> On 13/11/2026 08:41, David Brown wrote:
[...]
>> In C, the equality and relational operators evaluate to an "int" value
>> of either 0 or 1.  They never result in any other value.
>
> 0 has two representations in 1s-complement, all zeros or all ones. I am
> worried about that when using bitwise operators to implement logic in
> case a comparison yields an all-ones representation of 0. Do comparisons
> and ! always produce the all-zeros representation in 1s-complement machines?

C17 6.2.6.2p3,4:

    If the implementation supports negative zeros, they shall be
    generated only by:

    -- the &, |, ^, ~, <<, and >> operators with operands that
       produce such a value;

    -- the +, - , *, /, and % operators where one operand is a negative
       zero and the result is zero;

    -- compound assignment operators based on the above cases.

    It is unspecified whether these cases actually generate a negative
    zero or a normal zero, and whether a negative zero becomes a normal
    zero when stored in an object.

    If the implementation does not support negative zeros, the behavior
    of the &, |, ^, ~, <<, and >> operators with operands that would
    produce such a value is undefined.

So the equality and comparison operators never yield a negative zero.

C23 drops this and requires 2's-complement.

You are extremely unlikely to encounter a pre-C23 C implementation that
doesn't use 2's-complement.

[...]

>> And don't bother with the "register" keyword.  Optimising compilers have
>> ignored that for decades, and C++ removed it in C++17 (while preserving
>> it as a keyword for future usage).
>
> It ought to have been kept meaningful in C++ to mask operator& at least.
> I recall it was at least as early as C++98 that it was noneffective,
> definitely I know it was before C++17 because I never used C++17.

I've never had a need to disable unary &.  Have you?

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1524
Author: Tristan Wibberley
Date: Fri, 13 Nov 2026 21:33
48 lines
3638 bytes
On 13/11/2026 19:46, Keith Thompson wrote:
> Tristan Wibberley <tristan.wibberley+netnews2@alumni.manchester.ac.uk>
> writes:
>> On 13/11/2026 08:41, David Brown wrote:
> [...]
>>> In C, the equality and relational operators evaluate to an "int" value
>>> of either 0 or 1.  They never result in any other value.
>>
>> 0 has two representations in 1s-complement, all zeros or all ones. I am
>> worried about that when using bitwise operators to implement logic in
>> case a comparison yields an all-ones representation of 0. Do comparisons
>> and ! always produce the all-zeros representation in 1s-complement machines?
> 
> C17 6.2.6.2p3,4:

...

> So the equality and comparison operators never yield a negative zero.

Thanks I should have taken the time to read a published final draft.


>>> And don't bother with the "register" keyword.  Optimising compilers have
>>> ignored that for decades, and C++ removed it in C++17 (while preserving
>>> it as a keyword for future usage).
>>
>> It ought to have been kept meaningful in C++ to mask operator& at least.
>> I recall it was at least as early as C++98 that it was noneffective,
>> definitely I know it was before C++17 because I never used C++17.
> 
> I've never had a need to disable unary &.  Have you?

I've had situations that would be benefitted by it, eliminating various
opportunities can make some code simpler.


-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1525
Author: Tristan Wibberley
Date: Fri, 13 Nov 2026 22:21
160 lines
8068 bytes
On 13/11/2026 16:49, David Brown wrote:
> On 13/11/2026 16:27, Tristan Wibberley wrote:
>> On 13/11/2026 08:41, David Brown wrote:
>>> On 12/11/2026 23:27, Tristan Wibberley wrote:
>>>> On 12/11/2026 19:44, Tristan Wibberley wrote:
>>>>> On 06/11/2026 01:12, Lawrence D’Oliveiro wrote:

> There is no benefit in using bitwise operators when
> the logical operators are appropriate - unless you count "confusing
> readers" as a benefit.

That's definitely not true, being able to know both lhs and rhs are
evaluated regardless of the value of the other from just a glance at the
code is beneficial. Begin able to know that, when they're function
calls, side-effects of both will occur is beneficial.


>>> The only time an optimising
>>> compiler actually follows the rules about what is and what is not
>>> evaluated, is when there are side-effects that could potentially lead to
>>> observable behaviour.
>>
>> For sufficiently restrictive definitions of "observable".
> 
> The C standards define "observable behaviour", and that is the
> definition I use.

Noted for this occasion, I will forget that you're using it in future.


>>> The most sensible way to write your code - IMHO - is to use bitwise
>>> operators only when you actually mean bitwise operations such as
>>> masking.

For this purpose, they actually are logical too, one of the bits
nominated by the implementation has the required meaning. It is
commonplace to do this when two or more dimensions are involved, this is
merely extending the practice down to when just one dimension is involved.


>> Using shortcutting when you don't require shortcutting has a meaningful
>> effect on objective measures of the complexity of the system (as does
>> using an unspecified order with bitwise operators.
> 
> What meaningful effect?  The evaluation of an expression that does not
> affect C observable behaviour has /zero/ "meaningful effect" in C.

Meaningful effect "on objective measures of the complexity of the
system". shortcutting increases cyclomatic complexity which is often
considered a cost.


> But do you understand what "evaluates" means here?

Yes. in great detail.


>> The types of failure that can be caused by that difference can matter.
> 
> Do you have an example in mind?  That might make it easier to understand
> what you are talking about.

Yes but I'm feeling pretty tired. You will know what kinds of problems
can occur in a system containing a C program among its constituents
based on orderings of effects or based on conditional effects.

> 
>>
>> Using the bitwise operators can cause usage of shared resources to vary
>> across the domain. 
> 
> I have no idea what you mean by this.

Different cases of a function's inputs could make a resource that both
operands manipulate change in ways that are described non-uniformly
across cases, extrapolation from test cases to all other cases to
predict compliance can be wrong.


>> Idempotency mitigates this and is advisable widely
>> anyway, so for techniques to avoid shared resources from existing
>> anyway.
> 
> I have no idea what you mean by this.  You might be using the word
> "idempotency" incorrectly.  (An operation "op" is "idempotent" if and
> only if "x op x == x" for all "x".)

I understand the term to be used slightly more broadly but only
slightly. What I had in mind is only irrelevantly different from your
definition.

many classes of invalid programs caused by being affected by ordering
can be made valid by using idempotency in their side-effects.

Then I meant "also for techniques..." which are such a big group that
I'm not going to bother giving examples because this has started to feel
like a job interview which I do not want.


>> The integration solutions for such problems are some of the
>> intuitive ones relied on when integrating independent active systems
>> anyway (ie, we already think about systems in terms of "the two effects
>> happen, make sure your stuff works in case of whichever order"). 
> 
> Are you trying to say that since the order of evaluation of the sub-
> expressions for most operators (including the bitwise ones) is not
> specified, your code should not rely on any specific ordering?  That is
> obviously true.

I'm saying we make systems that do not rely on ordering all the time and
the management of a development process involving just more of the same
is easiest.


>> One can
>> signal an effect threshold wrapping the logic in a trigger call and so
>> forth.
> 
> Again, I have no idea what you are trying to say here.

One can call a finalisation function after the conditions have been
evaluated which delimits a segment of program addresses in which some
signal is permissibly invalid. That can include I/O so that external
signals are issued.


> 
>>
>> Using the logical operators can cause usage of private resources to vary
>> across the domain. It remains a problem even when other good practices
>> have been applied.
> 
> You are going to have to give examples or explain better.

Different cases of a function's inputs could make a resource that the
rhs manipulates change in ways that are described non-uniformly across
cases, extrapolation from test cases to all other cases to predict
compliance can be wrong.

Matters of ordering are experienced through systems at all scales and
are solved with a few practices all over all the systems, in particular,
systems are very commonly composed of parts that act independently
except when explicitly excluding each other by signalling protocols (or
by a scheduler or broker). Matters of shortcutting are different so
those very common practices don't all apply helpfully, making
shortcutting, in my mind, a choice to make very cautiously.


-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1541
Author: Tristan Wibberley
Date: Sat, 14 Nov 2026 19:05
27 lines
2622 bytes
On 06/11/2026 15:33, James Kuyper wrote:
> On 2026-11-06 00:35, Keith Thompson wrote:
>> James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>> [...]
>>>                                  Otherwise, one or more parentheses
>>> might solve the problem.
>>
>> Technically correct (the best kind of correct), but *two* or more
>> parentheses are even better.
> I should have said "... one or more matched pairs of parentheses ...".


You have clearly suffered the pedants more than one man should have to
bear. I feel for you.

-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1542
Author: Tristan Wibberley
Date: Sat, 14 Nov 2026 19:07
32 lines
2664 bytes
On 10/11/2026 16:41, Bonita Montero wrote:
> Am 10.11.2026 um 09:58 schrieb Fred. Zwarts:
>> Op 09.nov.2026 om 10:03 schreef Bonita Montero:
>>> Am 06.11.2026 um 00:42 schrieb Lynn McGuire:
>>>
>>>> if (j1 * i1 < 1) {
>>>>      goto L463;
>>>> }
>>>> ...
>>>> if ((j1 * i1) < 1) {
>>>>      goto L463;
>>>> }
>>> The latter one leads to more optimized code !
>>
>> Really? Why?
> 
> It's faster the more braces you have.

They're the go-faster stripes of programming. That's why LISP is so fast.

-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1545
Author: James Kuyper
Date: Sun, 15 Nov 2026 01:52
17 lines
2127 bytes
On 2026-11-14 14:05, Tristan Wibberley wrote:
> On 06/11/2026 15:33, James Kuyper wrote:
>> On 2026-11-06 00:35, Keith Thompson wrote:
>>> James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>>> [...]
>>>>                                  Otherwise, one or more parentheses
>>>> might solve the problem.
>>>
>>> Technically correct (the best kind of correct), but *two* or more
>>> parentheses are even better.
>> I should have said "... one or more matched pairs of parentheses ...".
> 
> 
> You have clearly suffered the pedants more than one man should have to
> bear. I feel for you.
I am one of the worst pedants you're likely to meet. I cannot object to
such minor pedantry.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1546
Author: Keith Thompson
Date: Sun, 15 Nov 2026 02:22
28 lines
2428 bytes
James Kuyper <jameskuyper@alumni.caltech.edu> writes:
> On 2026-11-14 14:05, Tristan Wibberley wrote:
>> On 06/11/2026 15:33, James Kuyper wrote:
>>> On 2026-11-06 00:35, Keith Thompson wrote:
>>>> James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>>>> [...]
>>>>>                                  Otherwise, one or more parentheses
>>>>> might solve the problem.
>>>>
>>>> Technically correct (the best kind of correct), but *two* or more
>>>> parentheses are even better.
>>>
>>> I should have said "... one or more matched pairs of parentheses ...".
>> 
>> You have clearly suffered the pedants more than one man should have to
>> bear. I feel for you.
>
> I am one of the worst pedants you're likely to meet. I cannot object to
> such minor pedantry.

Pedants unite!

And my remark was intended mostly for humorous effect.  (Hoping
this doesn't start a debate about whether it was funny.)

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1548
Author: Janis Papanagnou
Date: Sun, 15 Nov 2026 03:28
46 lines
3133 bytes
On 2026-11-15 03:22, Keith Thompson wrote:
> James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>> On 2026-11-14 14:05, Tristan Wibberley wrote:
>>> On 06/11/2026 15:33, James Kuyper wrote:
>>>> On 2026-11-06 00:35, Keith Thompson wrote:
>>>>> James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>>>>> [...]
>>>>>>                                   Otherwise, one or more parentheses
>>>>>> might solve the problem.
>>>>>
>>>>> Technically correct (the best kind of correct), but *two* or more
>>>>> parentheses are even better.
>>>>
>>>> I should have said "... one or more matched pairs of parentheses ...".
>>>
>>> You have clearly suffered the pedants more than one man should have to
>>> bear. I feel for you.
>>
>> I am one of the worst pedants you're likely to meet. I cannot object to
>> such minor pedantry.

:-)

> Pedants unite!

Ped-ants un-ite.

Did it occur to you that "ped" is a Latin prefix for "foot", that
"ants" are insects with many feet, and "ite" in Latin means "go!",
and I wonder why there's the "un" prefix that negates "un-ite" as
"Don't go!". Probably a hidden request to not use "Go" as language
but rather focus on "C" here?!

> 
> And my remark was intended mostly for humorous effect. 

Please abstain from all humorous statements! - Note: "We [...] do
not have a sense of humor we're aware of." (You know the quote!?)

> (Hoping this doesn't start a debate about whether it was funny.)

Oops! - You failed in a way. - Oh, "a way"; we *go* on a way. -
I suspect a conspiracy to subvert the purpose of this newsgroup!

Janis
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1555
Author: David Brown
Date: Sun, 15 Nov 2026 12:09
288 lines
13522 bytes
On 13/11/2026 23:21, Tristan Wibberley wrote:
> On 13/11/2026 16:49, David Brown wrote:
>> On 13/11/2026 16:27, Tristan Wibberley wrote:
>>> On 13/11/2026 08:41, David Brown wrote:
>>>> On 12/11/2026 23:27, Tristan Wibberley wrote:
>>>>> On 12/11/2026 19:44, Tristan Wibberley wrote:
>>>>>> On 06/11/2026 01:12, Lawrence D’Oliveiro wrote:
> 
>> There is no benefit in using bitwise operators when
>> the logical operators are appropriate - unless you count "confusing
>> readers" as a benefit.
> 
> That's definitely not true, being able to know both lhs and rhs are
> evaluated regardless of the value of the other from just a glance at the
> code is beneficial. Begin able to know that, when they're function
> calls, side-effects of both will occur is beneficial.
> 

As I said, there is no benefit in using bitwise operators when logical 
operators are appropriate.  If you are relying on the evaluation of "B" 
in the expression "A op B", then using logical operators would not be 
appropriate.

But I think it could be considered bad style, and potentially confusing, 
if you wrote "success = foo() & bar();" where these two functions 
returned pass / fail indications and you used this formulation to say 
that both had to be run, with "success" being the conjunction.  It would 
be more idiomatic, I think, to call them separately.  With bitwise and 
here, readers would wonder if you had really meant to use logical and.

The details of the rest of the code, the names of the functions, and so 
on, would of course greatly influence how readers would interpret the 
code.  But my feeling is that when a reader sees at a glance the bitwise 
and operator between two function calls, they would not immediately 
conclude that you used bitwise and so that the rhs was also evaluated - 
they would guess that you made a mistake in the code.


> 
>>>> The only time an optimising
>>>> compiler actually follows the rules about what is and what is not
>>>> evaluated, is when there are side-effects that could potentially lead to
>>>> observable behaviour.
>>>
>>> For sufficiently restrictive definitions of "observable".
>>
>> The C standards define "observable behaviour", and that is the
>> definition I use.
> 
> Noted for this occasion, I will forget that you're using it in future.
> 

I can try and remember to make it clearer in the future.  But since this 
is comp.lang.c and comp.lang.c++, and "observable behaviour" is a very 
specific term from the standards that is critical to understanding the 
semantics of these languages, I think you should get used to the term. 
The word "behaviour" on its own is likely to be used more generally.

> 
>>>> The most sensible way to write your code - IMHO - is to use bitwise
>>>> operators only when you actually mean bitwise operations such as
>>>> masking.
> 
> For this purpose, they actually are logical too, one of the bits
> nominated by the implementation has the required meaning. It is
> commonplace to do this when two or more dimensions are involved, this is
> merely extending the practice down to when just one dimension is involved.
> 

You can certainly use the bitwise operators to have the same effect 
effect as the logical operators (apart from evaluation guarantees), in 
the same way that you can write "x + x + x" instead of "x * 3" - using 
the addition operator to do multiplication.  In general, I don't think 
it is a good idea, even though compilers will often generate identical 
code.  You would even get the same results replacing "&&" with "*", but 
that would be even less of a good idea.

> 
>>> Using shortcutting when you don't require shortcutting has a meaningful
>>> effect on objective measures of the complexity of the system (as does
>>> using an unspecified order with bitwise operators.
>>
>> What meaningful effect?  The evaluation of an expression that does not
>> affect C observable behaviour has /zero/ "meaningful effect" in C.
> 
> Meaningful effect "on objective measures of the complexity of the
> system". shortcutting increases cyclomatic complexity which is often
> considered a cost.
> 

Okay, I can see that :

	// success = foo() && bar()
	bool success = foo();
	if (success) {
		success = bar();
	}

	// success = foo() & bar()
	bool success_foo = foo();
	bool success_bar = bar();
	bool success = success_foo & success_bar;

Yes, the conditional increases the cyclomatic complexity of the code. 
But while cyclomatic complexity can sometimes be a useful and measurable 
metric, I am not at all convinced that it is often a particularly useful 
one except if you need to give an objective reason why a particular bad 
function is "clearly incomprehensible".

> 
>> But do you understand what "evaluates" means here?
> 
> Yes. in great detail.
> 
> 
>>> The types of failure that can be caused by that difference can matter.
>>
>> Do you have an example in mind?  That might make it easier to understand
>> what you are talking about.
> 
> Yes but I'm feeling pretty tired. You will know what kinds of problems
> can occur in a system containing a C program among its constituents
> based on orderings of effects or based on conditional effects.
> 

Fair enough.  It means that I am sticking to "foo() & bar()" examples, 
which might not match what you are thinking about.

Note that when you write "foo() & bar()", where these are both function 
calls, you are guaranteed that either "far()" is evaluated first and 
then "bar()" is evaluated, or vice-versa.  You have no control over 
their order of evaluation.  And if these are not function calls, but are 
other kinds of sub-expressions (or perhaps macros), their evaluation can 
be interleaved.

If you need to control the order of evaluation and side-effects, you 
should do so with separate statements.  Call "foo" first in one 
statement, then call "bar".

>>
>>>
>>> Using the bitwise operators can cause usage of shared resources to vary
>>> across the domain.
>>
>> I have no idea what you mean by this.
> 
> Different cases of a function's inputs could make a resource that both
> operands manipulate change in ways that are described non-uniformly
> across cases, extrapolation from test cases to all other cases to
> predict compliance can be wrong.
> 

I still fail to see a relevancy.  If you can give an example, great.  If 
not, I will leave it.

> 
>>> Idempotency mitigates this and is advisable widely
>>> anyway, so for techniques to avoid shared resources from existing
>>> anyway.
>>
>> I have no idea what you mean by this.  You might be using the word
>> "idempotency" incorrectly.  (An operation "op" is "idempotent" if and
>> only if "x op x == x" for all "x".)
> 
> I understand the term to be used slightly more broadly but only
> slightly. What I had in mind is only irrelevantly different from your
> definition.
> 

Its definition can certainly be broadened beyond just binary operators, 
but I agree that would not be relevant.

> many classes of invalid programs caused by being affected by ordering
> can be made valid by using idempotency in their side-effects.

For example :

	bool initialised;
	void initialise() {
		// Do useful stuff
		initialised = true;
	}

	bool foo() {
		if (!initialised) initialise();
		return do_foo();
	}

	bool bar() {
		if (!initialised) initialise();
		return do_bar();
	}

Then it does not matter which of "foo" and "bar" is called first in 
"foo() & bar()", because they are "idempotent" in ensuring that the 
initialisation is done correctly.  Is this what you are talking about?

The "static initialisation order fiasco" is a real thing, and programs 
have had bugs from getting this kind of thing wrong.  But I can't see 
its relevance in the choice of using bitwise & for logical operations.

> 
> Then I meant "also for techniques..." which are such a big group that
> I'm not going to bother giving examples because this has started to feel
> like a job interview which I do not want.

I am just trying to understand your perspective, that's all.  There is 
no job at the end of it, and no pressure for you to write more than you 
want to.  Discussing how and why people write code in different ways can 
teach us new ways to write code, or give better appreciation for why 
people write or interpret code differently.

> 
> 
>>> The integration solutions for such problems are some of the
>>> intuitive ones relied on when integrating independent active systems
>>> anyway (ie, we already think about systems in terms of "the two effects
>>> happen, make sure your stuff works in case of whichever order").
>>
>> Are you trying to say that since the order of evaluation of the sub-
>> expressions for most operators (including the bitwise ones) is not
>> specified, your code should not rely on any specific ordering?  That is
>> obviously true.
> 
> I'm saying we make systems that do not rely on ordering all the time and
> the management of a development process involving just more of the same
> is easiest.
> 
> 
>>> One can
>>> signal an effect threshold wrapping the logic in a trigger call and so
>>> forth.
>>
>> Again, I have no idea what you are trying to say here.
> 
> One can call a finalisation function after the conditions have been
> evaluated which delimits a segment of program addresses in which some
> signal is permissibly invalid. That can include I/O so that external
> signals are issued.
> 
> 
>>
>>>
>>> Using the logical operators can cause usage of private resources to vary
>>> across the domain. It remains a problem even when other good practices
>>> have been applied.
>>
>> You are going to have to give examples or explain better.
> 
> Different cases of a function's inputs could make a resource that the
> rhs manipulates change in ways that are described non-uniformly across
> cases, extrapolation from test cases to all other cases to predict
> compliance can be wrong.
> 
> Matters of ordering are experienced through systems at all scales and
> are solved with a few practices all over all the systems, in particular,
> systems are very commonly composed of parts that act independently
> except when explicitly excluding each other by signalling protocols (or
> by a scheduler or broker). Matters of shortcutting are different so
> those very common practices don't all apply helpfully, making
> shortcutting, in my mind, a choice to make very cautiously.
> 
> 

When you write code in C or C++, you control the order of observable 
behaviour (as defined by the standards).  You don't control any other 
order, you don't control any timing, and you don't control when the 
compiler-generated code does extra work, or skips work, if the work does 
not influence observable behaviour.

You should not use && if you want the observable behaviour from the rhs 
regardless of the value of the lhs.  That's not special about 
shortcutting logical operators, that's just writing code that does what 
you want it to do.  Similarly, you should not use & for logical 
conjunction if you /do/ want shortcutting semantics.

But IMHO you should not use bitwise & when your code is expressing a 
logical intent - just as you should not use "int" when you mean "bool". 
That is not directly a matter of code correctness, but it is a matter of 
code style and unambiguous understanding from both readers and writers, 
and thus a reduction of the risk of bugs.

It is also very common in coding standards to say that statements should 
do one thing at a time.  Such rules would ban "foo() & bar()" and also 
"foo() && bar()" when both functions may have side-effects.  Follow that 
rule, and there is no risk due to the unspecified order of evaluation, 
nor any need to be concerned about "idempotency".
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1556
Author: Tristan Wibberley
Date: Sun, 15 Nov 2026 20:14
42 lines
3318 bytes
On 15/11/2026 02:22, Keith Thompson wrote:
> James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>> On 2026-11-14 14:05, Tristan Wibberley wrote:
>>> On 06/11/2026 15:33, James Kuyper wrote:
>>>> On 2026-11-06 00:35, Keith Thompson wrote:
>>>>> James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>>>>> [...]
>>>>>>                                  Otherwise, one or more parentheses
>>>>>> might solve the problem.
>>>>>
>>>>> Technically correct (the best kind of correct), but *two* or more
>>>>> parentheses are even better.
>>>>
>>>> I should have said "... one or more matched pairs of parentheses ...".
>>>
>>> You have clearly suffered the pedants more than one man should have to
>>> bear. I feel for you.
>>
>> I am one of the worst pedants you're likely to meet. I cannot object to
>> such minor pedantry.
> 
> Pedants unite!
> 
> And my remark was intended mostly for humorous effect.  (Hoping
> this doesn't start a debate about whether it was funny.)
> 

In nerd voice "Err, technically, according to ISO humour standard
10101010101, it was funny but not comical"

-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1557
Author: David Brown
Date: Mon, 16 Nov 2026 08:50
65 lines
3980 bytes
On 15/11/2026 04:28, Janis Papanagnou wrote:
> On 2026-11-15 03:22, Keith Thompson wrote:
>> James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>>> On 2026-11-14 14:05, Tristan Wibberley wrote:
>>>> On 06/11/2026 15:33, James Kuyper wrote:
>>>>> On 2026-11-06 00:35, Keith Thompson wrote:
>>>>>> James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>>>>>> [...]
>>>>>>>                                   Otherwise, one or more parentheses
>>>>>>> might solve the problem.
>>>>>>
>>>>>> Technically correct (the best kind of correct), but *two* or more
>>>>>> parentheses are even better.
>>>>>
>>>>> I should have said "... one or more matched pairs of parentheses ...".
>>>>
>>>> You have clearly suffered the pedants more than one man should have to
>>>> bear. I feel for you.
>>>
>>> I am one of the worst pedants you're likely to meet. I cannot object to
>>> such minor pedantry.
> 
> :-)
> 
>> Pedants unite!
> 
> Ped-ants un-ite.
> 
> Did it occur to you that "ped" is a Latin prefix for "foot", that
> "ants" are insects with many feet, and "ite" in Latin means "go!",
> and I wonder why there's the "un" prefix that negates "un-ite" as
> "Don't go!". Probably a hidden request to not use "Go" as language
> but rather focus on "C" here?!
> 

I'm taking James' claim as a challenge!  A /real/ pedant would know that 
"ped" is from the /Greek/ word for "child".  The etymology of "pedant" 
is an old word for "schoolmaster" or "teacher" (specifically of 
children).  :-)

>>
>> And my remark was intended mostly for humorous effect. 
> 
> Please abstain from all humorous statements! - Note: "We [...] do
> not have a sense of humor we're aware of." (You know the quote!?)

Is it from the USA airport security guard training manual?

(Yes, I know it is from a film, but I can't quite place it at the moment.)

> 
>> (Hoping this doesn't start a debate about whether it was funny.)

/I/ thought it was amusing.  But maybe I have a weird sense of humour. 
I am Scottish, after all, and in Scottish humour the smiley's are often 
bigger when they are well-hidden.

> 
> Oops! - You failed in a way. - Oh, "a way"; we *go* on a way. -
> I suspect a conspiracy to subvert the purpose of this newsgroup!
> 
Doesn't it have to be hidden to be a conspiracy?  Some people have been 
very open about trying to spoil the group!

Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1558
Author: Janis Papanagnou
Date: Mon, 16 Nov 2026 09:18
45 lines
3056 bytes
On 2026-11-16 09:50, David Brown wrote:
> On 15/11/2026 04:28, Janis Papanagnou wrote:
>>
>> Ped-ants un-ite.
>>
>> Did it occur to you that "ped" is a Latin prefix for "foot", that
>> "ants" are insects with many feet, and "ite" in Latin means "go!",
>> and I wonder why there's the "un" prefix that negates "un-ite" as
>> "Don't go!". Probably a hidden request to not use "Go" as language
>> but rather focus on "C" here?!
>>
> 
> I'm taking James' claim as a challenge!  A /real/ pedant would know that 
> "ped" is from the /Greek/ word for "child".  The etymology of "pedant" 
> is an old word for "schoolmaster" or "teacher" (specifically of 
> children).  :-)

Ah, it serves me right.

What do I know about Greek. Latin is already demanding enough. :-)

>>
>> [...] "We [...] do not have a sense of humor we're aware of." [...]
> 
> Is it from the USA airport security guard training manual?

(Ouch, yes. - Probably not only in the US. Strange people/processes.)

> 
> (Yes, I know it is from a film, but I can't quite place it at the moment.)

Men in Black. (The agents visiting a lady frustrated by the police,
and Tommy Lee Jones saying that.)

>> [...]
>> I suspect a conspiracy to subvert the purpose of this newsgroup!
>>
> Doesn't it have to be hidden to be a conspiracy?  [...]

I thought it had been quite hidden and it got revealed?

Now, unrevealed, the presumed conspiracy theory became a "fact". ;-)

Janis
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1559
Author: Ross Finlayson
Date: Mon, 16 Nov 2026 10:21
352 lines
16520 bytes
On 11/15/2026 04:09 AM, David Brown wrote:
> On 13/11/2026 23:21, Tristan Wibberley wrote:
>> On 13/11/2026 16:49, David Brown wrote:
>>> On 13/11/2026 16:27, Tristan Wibberley wrote:
>>>> On 13/11/2026 08:41, David Brown wrote:
>>>>> On 12/11/2026 23:27, Tristan Wibberley wrote:
>>>>>> On 12/11/2026 19:44, Tristan Wibberley wrote:
>>>>>>> On 06/11/2026 01:12, Lawrence D’Oliveiro wrote:
>>
>>> There is no benefit in using bitwise operators when
>>> the logical operators are appropriate - unless you count "confusing
>>> readers" as a benefit.
>>
>> That's definitely not true, being able to know both lhs and rhs are
>> evaluated regardless of the value of the other from just a glance at the
>> code is beneficial. Begin able to know that, when they're function
>> calls, side-effects of both will occur is beneficial.
>>
>
> As I said, there is no benefit in using bitwise operators when logical
> operators are appropriate.  If you are relying on the evaluation of "B"
> in the expression "A op B", then using logical operators would not be
> appropriate.
>
> But I think it could be considered bad style, and potentially confusing,
> if you wrote "success = foo() & bar();" where these two functions
> returned pass / fail indications and you used this formulation to say
> that both had to be run, with "success" being the conjunction.  It would
> be more idiomatic, I think, to call them separately.  With bitwise and
> here, readers would wonder if you had really meant to use logical and.
>
> The details of the rest of the code, the names of the functions, and so
> on, would of course greatly influence how readers would interpret the
> code.  But my feeling is that when a reader sees at a glance the bitwise
> and operator between two function calls, they would not immediately
> conclude that you used bitwise and so that the rhs was also evaluated -
> they would guess that you made a mistake in the code.
>
>
>>
>>>>> The only time an optimising
>>>>> compiler actually follows the rules about what is and what is not
>>>>> evaluated, is when there are side-effects that could potentially
>>>>> lead to
>>>>> observable behaviour.
>>>>
>>>> For sufficiently restrictive definitions of "observable".
>>>
>>> The C standards define "observable behaviour", and that is the
>>> definition I use.
>>
>> Noted for this occasion, I will forget that you're using it in future.
>>
>
> I can try and remember to make it clearer in the future.  But since this
> is comp.lang.c and comp.lang.c++, and "observable behaviour" is a very
> specific term from the standards that is critical to understanding the
> semantics of these languages, I think you should get used to the term.
> The word "behaviour" on its own is likely to be used more generally.
>
>>
>>>>> The most sensible way to write your code - IMHO - is to use bitwise
>>>>> operators only when you actually mean bitwise operations such as
>>>>> masking.
>>
>> For this purpose, they actually are logical too, one of the bits
>> nominated by the implementation has the required meaning. It is
>> commonplace to do this when two or more dimensions are involved, this is
>> merely extending the practice down to when just one dimension is
>> involved.
>>
>
> You can certainly use the bitwise operators to have the same effect
> effect as the logical operators (apart from evaluation guarantees), in
> the same way that you can write "x + x + x" instead of "x * 3" - using
> the addition operator to do multiplication.  In general, I don't think
> it is a good idea, even though compilers will often generate identical
> code.  You would even get the same results replacing "&&" with "*", but
> that would be even less of a good idea.
>
>>
>>>> Using shortcutting when you don't require shortcutting has a meaningful
>>>> effect on objective measures of the complexity of the system (as does
>>>> using an unspecified order with bitwise operators.
>>>
>>> What meaningful effect?  The evaluation of an expression that does not
>>> affect C observable behaviour has /zero/ "meaningful effect" in C.
>>
>> Meaningful effect "on objective measures of the complexity of the
>> system". shortcutting increases cyclomatic complexity which is often
>> considered a cost.
>>
>
> Okay, I can see that :
>
>      // success = foo() && bar()
>      bool success = foo();
>      if (success) {
>          success = bar();
>      }
>
>      // success = foo() & bar()
>      bool success_foo = foo();
>      bool success_bar = bar();
>      bool success = success_foo & success_bar;
>
> Yes, the conditional increases the cyclomatic complexity of the code.
> But while cyclomatic complexity can sometimes be a useful and measurable
> metric, I am not at all convinced that it is often a particularly useful
> one except if you need to give an objective reason why a particular bad
> function is "clearly incomprehensible".
>
>>
>>> But do you understand what "evaluates" means here?
>>
>> Yes. in great detail.
>>
>>
>>>> The types of failure that can be caused by that difference can matter.
>>>
>>> Do you have an example in mind?  That might make it easier to understand
>>> what you are talking about.
>>
>> Yes but I'm feeling pretty tired. You will know what kinds of problems
>> can occur in a system containing a C program among its constituents
>> based on orderings of effects or based on conditional effects.
>>
>
> Fair enough.  It means that I am sticking to "foo() & bar()" examples,
> which might not match what you are thinking about.
>
> Note that when you write "foo() & bar()", where these are both function
> calls, you are guaranteed that either "far()" is evaluated first and
> then "bar()" is evaluated, or vice-versa.  You have no control over
> their order of evaluation.  And if these are not function calls, but are
> other kinds of sub-expressions (or perhaps macros), their evaluation can
> be interleaved.
>
> If you need to control the order of evaluation and side-effects, you
> should do so with separate statements.  Call "foo" first in one
> statement, then call "bar".
>
>>>
>>>>
>>>> Using the bitwise operators can cause usage of shared resources to vary
>>>> across the domain.
>>>
>>> I have no idea what you mean by this.
>>
>> Different cases of a function's inputs could make a resource that both
>> operands manipulate change in ways that are described non-uniformly
>> across cases, extrapolation from test cases to all other cases to
>> predict compliance can be wrong.
>>
>
> I still fail to see a relevancy.  If you can give an example, great.  If
> not, I will leave it.
>
>>
>>>> Idempotency mitigates this and is advisable widely
>>>> anyway, so for techniques to avoid shared resources from existing
>>>> anyway.
>>>
>>> I have no idea what you mean by this.  You might be using the word
>>> "idempotency" incorrectly.  (An operation "op" is "idempotent" if and
>>> only if "x op x == x" for all "x".)
>>
>> I understand the term to be used slightly more broadly but only
>> slightly. What I had in mind is only irrelevantly different from your
>> definition.
>>
>
> Its definition can certainly be broadened beyond just binary operators,
> but I agree that would not be relevant.
>
>> many classes of invalid programs caused by being affected by ordering
>> can be made valid by using idempotency in their side-effects.
>
> For example :
>
>      bool initialised;
>      void initialise() {
>          // Do useful stuff
>          initialised = true;
>      }
>
>      bool foo() {
>          if (!initialised) initialise();
>          return do_foo();
>      }
>
>      bool bar() {
>          if (!initialised) initialise();
>          return do_bar();
>      }
>
> Then it does not matter which of "foo" and "bar" is called first in
> "foo() & bar()", because they are "idempotent" in ensuring that the
> initialisation is done correctly.  Is this what you are talking about?
>
> The "static initialisation order fiasco" is a real thing, and programs
> have had bugs from getting this kind of thing wrong.  But I can't see
> its relevance in the choice of using bitwise & for logical operations.
>
>>
>> Then I meant "also for techniques..." which are such a big group that
>> I'm not going to bother giving examples because this has started to feel
>> like a job interview which I do not want.
>
> I am just trying to understand your perspective, that's all.  There is
> no job at the end of it, and no pressure for you to write more than you
> want to.  Discussing how and why people write code in different ways can
> teach us new ways to write code, or give better appreciation for why
> people write or interpret code differently.
>
>>
>>
>>>> The integration solutions for such problems are some of the
>>>> intuitive ones relied on when integrating independent active systems
>>>> anyway (ie, we already think about systems in terms of "the two effects
>>>> happen, make sure your stuff works in case of whichever order").
>>>
>>> Are you trying to say that since the order of evaluation of the sub-
>>> expressions for most operators (including the bitwise ones) is not
>>> specified, your code should not rely on any specific ordering?  That is
>>> obviously true.
>>
>> I'm saying we make systems that do not rely on ordering all the time and
>> the management of a development process involving just more of the same
>> is easiest.
>>
>>
>>>> One can
>>>> signal an effect threshold wrapping the logic in a trigger call and so
>>>> forth.
>>>
>>> Again, I have no idea what you are trying to say here.
>>
>> One can call a finalisation function after the conditions have been
>> evaluated which delimits a segment of program addresses in which some
>> signal is permissibly invalid. That can include I/O so that external
>> signals are issued.
>>
>>
>>>
>>>>
>>>> Using the logical operators can cause usage of private resources to
>>>> vary
>>>> across the domain. It remains a problem even when other good practices
>>>> have been applied.
>>>
>>> You are going to have to give examples or explain better.
>>
>> Different cases of a function's inputs could make a resource that the
>> rhs manipulates change in ways that are described non-uniformly across
>> cases, extrapolation from test cases to all other cases to predict
>> compliance can be wrong.
>>
>> Matters of ordering are experienced through systems at all scales and
>> are solved with a few practices all over all the systems, in particular,
>> systems are very commonly composed of parts that act independently
>> except when explicitly excluding each other by signalling protocols (or
>> by a scheduler or broker). Matters of shortcutting are different so
>> those very common practices don't all apply helpfully, making
>> shortcutting, in my mind, a choice to make very cautiously.
>>
>>
>
> When you write code in C or C++, you control the order of observable
> behaviour (as defined by the standards).  You don't control any other
> order, you don't control any timing, and you don't control when the
> compiler-generated code does extra work, or skips work, if the work does
> not influence observable behaviour.
>
> You should not use && if you want the observable behaviour from the rhs
> regardless of the value of the lhs.  That's not special about
> shortcutting logical operators, that's just writing code that does what
> you want it to do.  Similarly, you should not use & for logical
> conjunction if you /do/ want shortcutting semantics.
>
> But IMHO you should not use bitwise & when your code is expressing a
> logical intent - just as you should not use "int" when you mean "bool".
> That is not directly a matter of code correctness, but it is a matter of
> code style and unambiguous understanding from both readers and writers,
> and thus a reduction of the risk of bugs.
>
> It is also very common in coding standards to say that statements should
> do one thing at a time.  Such rules would ban "foo() & bar()" and also
> "foo() && bar()" when both functions may have side-effects.  Follow that
> rule, and there is no risk due to the unspecified order of evaluation,
> nor any need to be concerned about "idempotency".
>


One way to read what your saying is "algebraizations" and
"arithmetizations", that's the act of interpreting models of
objects their matters of relation according to the matters of
relation of algebras and arithmetic.

It's totally usual for example with model of "machine" integers
and "machine" arithmetic that being a bounded sort of version
of "natural" integers and "natural" arithmetic, counts or tallies
of things like counters or accumulators according to operations
of arithmetic models of counts of things (which are models of
relations of objects, generally enough, "the things").

Then where for example "== is an operator", it results Boolean
algebras and bit-wise predication Boolean lattices, algebraizations.


It's totally similar with for example operations on formal words
from formal languages like "+" for "concatenation". "Model theory
is as model theory does."


Then AND OR XOT NOT or bit-wise "arithmetic", is sort of about
lattices of algebras, about that algebras aren't necessarily
arithmetic, then that making vector of those is sort of attaining
to "geometrization", or, also algebras of algebras, or sometimes
called "magmas", that "magmas" are a bit looser definition inclusive
of "algebras", which already are pretty loose since for example
"semi-simple" or "non-commutative" groups and the like, divergent from
arithmetic.



So, one can define interpretation of the operations where the
language makes for overloading operators any way you want,
which may make sense when it models natural operations that
happen to stand in as modeling algebras for example arithmetic,
then though that just using arithmetic and machine integers
as the model itself, also requires that it is what it is.

Then "enum" is another usual sort of example, like for "un_set,
un_legal, un_known", reserved values, where reserved values
are another sort of account, like: "Not-A-Number".

Machine integers can't quite achieve all of arithmetic themselves,
while yet there are algebras & magmas of anything.


There's a great book "Data Logic" from the 1970's I found one
day in the university library stacks somewhere in Q section,
been looking for that for a while, and it has lots of great
accounts of data and the logic.



"1's and 0's versus true and false?" Why lose, ....


Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1560
Author: Ross Finlayson
Date: Mon, 16 Nov 2026 10:27
51 lines
3395 bytes
On 11/16/2026 01:18 AM, Janis Papanagnou wrote:
> On 2026-11-16 09:50, David Brown wrote:
>> On 15/11/2026 04:28, Janis Papanagnou wrote:
>>>
>>> Ped-ants un-ite.
>>>
>>> Did it occur to you that "ped" is a Latin prefix for "foot", that
>>> "ants" are insects with many feet, and "ite" in Latin means "go!",
>>> and I wonder why there's the "un" prefix that negates "un-ite" as
>>> "Don't go!". Probably a hidden request to not use "Go" as language
>>> but rather focus on "C" here?!
>>>
>>
>> I'm taking James' claim as a challenge!  A /real/ pedant would know
>> that "ped" is from the /Greek/ word for "child".  The etymology of
>> "pedant" is an old word for "schoolmaster" or "teacher" (specifically
>> of children).  :-)
>
> Ah, it serves me right.
>
> What do I know about Greek. Latin is already demanding enough. :-)
>
>>>
>>> [...] "We [...] do not have a sense of humor we're aware of." [...]
>>
>> Is it from the USA airport security guard training manual?
>
> (Ouch, yes. - Probably not only in the US. Strange people/processes.)
>
>>
>> (Yes, I know it is from a film, but I can't quite place it at the
>> moment.)
>
> Men in Black. (The agents visiting a lady frustrated by the police,
> and Tommy Lee Jones saying that.)
>
>>> [...]
>>> I suspect a conspiracy to subvert the purpose of this newsgroup!
>>>
>> Doesn't it have to be hidden to be a conspiracy?  [...]
>
> I thought it had been quite hidden and it got revealed?
>
> Now, unrevealed, the presumed conspiracy theory became a "fact". ;-)
>
> Janis
>

Same root, was "knee-high" vis-a-vis "ankle-biters".

Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1561
Author: David Brown
Date: Mon, 16 Nov 2026 11:37
19 lines
2566 bytes
On 16/11/2026 11:21, Ross Finlayson wrote:
> 
> One way to read what your saying is "algebraizations" and
> "arithmetizations", that's the act of interpreting models of
> objects their matters of relation according to the matters of
> relation of algebras and arithmetic.
> 
No, that is not a way to read what I wrote.  I wrote in English.

Please find some way to write comprehensibly, without the waffling and 
rambling, and focusing on the point you are trying to make.

Maybe you could try this for a plan.  Before hitting "send" on a post, 
give the post to your favourite AI slopbot and ask it to generate a 
single paragraph summary.  If that summary does not match what you 
wanted to say, you know you need to express your post differently.  And 
if it /does/ match what you want to say, just post that summary so that 
other people don't need to wade through your original post.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1562
Author: David Brown
Date: Mon, 16 Nov 2026 11:43
61 lines
3588 bytes
On 16/11/2026 10:18, Janis Papanagnou wrote:
> On 2026-11-16 09:50, David Brown wrote:
>> On 15/11/2026 04:28, Janis Papanagnou wrote:
>>>
>>> Ped-ants un-ite.
>>>
>>> Did it occur to you that "ped" is a Latin prefix for "foot", that
>>> "ants" are insects with many feet, and "ite" in Latin means "go!",
>>> and I wonder why there's the "un" prefix that negates "un-ite" as
>>> "Don't go!". Probably a hidden request to not use "Go" as language
>>> but rather focus on "C" here?!
>>>
>>
>> I'm taking James' claim as a challenge!  A /real/ pedant would know 
>> that "ped" is from the /Greek/ word for "child".  The etymology of 
>> "pedant" is an old word for "schoolmaster" or "teacher" (specifically 
>> of children).  :-)
> 
> Ah, it serves me right.

As we all know, Usenet is a place to learn new things!

> 
> What do I know about Greek. Latin is already demanding enough. :-)

For much of the Roman empire, Latin was the language of the plebs - the 
educated upper classes all spoke Greek.  (Their schoolteachers - their 
pedants - were mostly Greek slaves.)

> 
>>>
>>> [...] "We [...] do not have a sense of humor we're aware of." [...]
>>
>> Is it from the USA airport security guard training manual?
> 
> (Ouch, yes. - Probably not only in the US. Strange people/processes.)
> 
>>
>> (Yes, I know it is from a film, but I can't quite place it at the 
>> moment.)
> 
> Men in Black. (The agents visiting a lady frustrated by the police,
> and Tommy Lee Jones saying that.)
> 

That's the one, yes.

>>> [...]
>>> I suspect a conspiracy to subvert the purpose of this newsgroup!
>>>
>> Doesn't it have to be hidden to be a conspiracy?  [...]
> 
> I thought it had been quite hidden and it got revealed?
> 
> Now, unrevealed, the presumed conspiracy theory became a "fact". ;-)
> 
What if it starts unrevealed, and then becomes a conspiracy theory - 
like the "fact" that birds don't exist?


Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1563
Author: Ross Finlayson
Date: Mon, 16 Nov 2026 11:57
44 lines
3493 bytes
On 11/16/2026 03:37 AM, David Brown wrote:
> On 16/11/2026 11:21, Ross Finlayson wrote:
>>
>> One way to read what your saying is "algebraizations" and
>> "arithmetizations", that's the act of interpreting models of
>> objects their matters of relation according to the matters of
>> relation of algebras and arithmetic.
>>
> No, that is not a way to read what I wrote.  I wrote in English.
>
> Please find some way to write comprehensibly, without the waffling and
> rambling, and focusing on the point you are trying to make.
>
> Maybe you could try this for a plan.  Before hitting "send" on a post,
> give the post to your favourite AI slopbot and ask it to generate a
> single paragraph summary.  If that summary does not match what you
> wanted to say, you know you need to express your post differently.  And
> if it /does/ match what you want to say, just post that summary so that
> other people don't need to wade through your original post.
>

I dispute your estimation of my command of English.

Wherever you got the impression that what I write
isn't perfectly grammatical, if long-winded and
for some a bit the too run-on the style, forget it.

Of course above where I wrote "your" for "you're",
that's intolerable.


Once I asked one of those "on-line grade estimators"
a sample of writing. This is where, for example,
editors of things like newspapers would be aware
of things like "news articles are written toa 6'th
grade reading level".

It said "Grade 26". Maybe it's the reading not
the writing the problem.

I will not insult your intelligence by insulting
your intelligence by insulting your intelligence.

Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1564
Author: Ross Finlayson
Date: Mon, 16 Nov 2026 12:37
72 lines
4387 bytes
On 11/16/2026 03:57 AM, Ross Finlayson wrote:
> On 11/16/2026 03:37 AM, David Brown wrote:
>> On 16/11/2026 11:21, Ross Finlayson wrote:
>>>
>>> One way to read what your saying is "algebraizations" and
>>> "arithmetizations", that's the act of interpreting models of
>>> objects their matters of relation according to the matters of
>>> relation of algebras and arithmetic.
>>>
>> No, that is not a way to read what I wrote.  I wrote in English.
>>
>> Please find some way to write comprehensibly, without the waffling and
>> rambling, and focusing on the point you are trying to make.
>>
>> Maybe you could try this for a plan.  Before hitting "send" on a post,
>> give the post to your favourite AI slopbot and ask it to generate a
>> single paragraph summary.  If that summary does not match what you
>> wanted to say, you know you need to express your post differently.  And
>> if it /does/ match what you want to say, just post that summary so that
>> other people don't need to wade through your original post.
>>
>
> I dispute your estimation of my command of English.
>
> Wherever you got the impression that what I write
> isn't perfectly grammatical, if long-winded and
> for some a bit the too run-on the style, forget it.
>
> Of course above where I wrote "your" for "you're",
> that's intolerable.
>
>
> Once I asked one of those "on-line grade estimators"
> a sample of writing. This is where, for example,
> editors of things like newspapers would be aware
> of things like "news articles are written toa 6'th
> grade reading level".
>
> It said "Grade 26". Maybe it's the reading not
> the writing the problem.
>
> I will not insult your intelligence by insulting
> your intelligence by insulting your intelligence.
>
>


So, back to "algebraizations" and "arithmetizations",
then of course there's no end of accounts of applying
algebraizations by modeling arithmetizations, or,
overloading operations.

Then if you'll excuse me, your perhaps constructive
criticism, repeated insertedly, was not well-received,
though of course you're welcome to your own opinion.


The Japanese have a saying, now it's in English,
"If you believe everything you read: maybe you shouldn't."


Now if you'll excuse me I'll putter off.



The "magma-oriented programming" then is rather sort
of like when there's a hammer and things look like nails,
"when all there is is slop, all you need is a mop".

Magma-Oriented Programming

Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1566
Author: David Brown
Date: Mon, 16 Nov 2026 14:04
60 lines
4749 bytes
On 16/11/2026 12:57, Ross Finlayson wrote:
> On 11/16/2026 03:37 AM, David Brown wrote:
>> On 16/11/2026 11:21, Ross Finlayson wrote:
>>>
>>> One way to read what your saying is "algebraizations" and
>>> "arithmetizations", that's the act of interpreting models of
>>> objects their matters of relation according to the matters of
>>> relation of algebras and arithmetic.
>>>
>> No, that is not a way to read what I wrote.  I wrote in English.
>>
>> Please find some way to write comprehensibly, without the waffling and
>> rambling, and focusing on the point you are trying to make.
>>
>> Maybe you could try this for a plan.  Before hitting "send" on a post,
>> give the post to your favourite AI slopbot and ask it to generate a
>> single paragraph summary.  If that summary does not match what you
>> wanted to say, you know you need to express your post differently.  And
>> if it /does/ match what you want to say, just post that summary so that
>> other people don't need to wade through your original post.
>>
> 
> I dispute your estimation of my command of English.
> 
> Wherever you got the impression that what I write
> isn't perfectly grammatical, if long-winded and
> for some a bit the too run-on the style, forget it.
> 
> Of course above where I wrote "your" for "you're",
> that's intolerable.


Your grammar is imperfect, but not nearly bad enough to be an issue. 
Real problems include your regular use of words and phrases in a way 
that simply does not match their meaning.  Run-on sentences are bad when 
they are too frequent, but made much worse by your overuse of "filler" 
words and phrases.  Much of what you write would be more appropriate for 
a politician giving a filibuster speech.

The root problem, I think, is that you have no focus in your writing. 
There is an open conduct between your thoughts and the words you type. 
Your thoughts wander, and - like everyone else - /you/ understand what 
you are thinking about.  But other people do not live in your head.  If 
you want people to understand what you are thinking about, you have to 
write in a way that other people can understand it - not just throw your 
thoughts at a page randomly.

I believe you have things worth saying.  That's why I am trying to 
suggest how you can improve your communication skills.  Many others just 
write your posts off as "gobbledegook" or ignore them entirely.  (The 
number of people that have given such feedback should be an indication 
that the problem here is the writer, not the readers.)

This will, I think, be the last post I make directly to you (at least 
for a while) - unless you specifically ask for something.  If you 
understand what I am trying to say, and appreciate that you have a 
serious problem communicating, then you can do something about it.  If 
you don't think that is the case, then you will continue to write posts 
that are mostly ignored because they are simply too much effort to read.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1567
Author: Tim Rentsch
Date: Mon, 16 Nov 2026 14:18
9 lines
1875 bytes
Ross Finlayson <ross.a.finlayson@gmail.com> writes:

> [suggestions for writing improvement]
>
> I dispute your estimation of my command of English.

The question here isn't your command of English.
It's the quality of the writing.  Or the lack
thereof.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1575
Author: Ross Finlayson
Date: Mon, 16 Nov 2026 16:33
94 lines
6272 bytes
On 11/16/2026 06:04 AM, David Brown wrote:
> On 16/11/2026 12:57, Ross Finlayson wrote:
>> On 11/16/2026 03:37 AM, David Brown wrote:
>>> On 16/11/2026 11:21, Ross Finlayson wrote:
>>>>
>>>> One way to read what your saying is "algebraizations" and
>>>> "arithmetizations", that's the act of interpreting models of
>>>> objects their matters of relation according to the matters of
>>>> relation of algebras and arithmetic.
>>>>
>>> No, that is not a way to read what I wrote.  I wrote in English.
>>>
>>> Please find some way to write comprehensibly, without the waffling and
>>> rambling, and focusing on the point you are trying to make.
>>>
>>> Maybe you could try this for a plan.  Before hitting "send" on a post,
>>> give the post to your favourite AI slopbot and ask it to generate a
>>> single paragraph summary.  If that summary does not match what you
>>> wanted to say, you know you need to express your post differently.  And
>>> if it /does/ match what you want to say, just post that summary so that
>>> other people don't need to wade through your original post.
>>>
>>
>> I dispute your estimation of my command of English.
>>
>> Wherever you got the impression that what I write
>> isn't perfectly grammatical, if long-winded and
>> for some a bit the too run-on the style, forget it.
>>
>> Of course above where I wrote "your" for "you're",
>> that's intolerable.
>
>
> Your grammar is imperfect, but not nearly bad enough to be an issue.
> Real problems include your regular use of words and phrases in a way
> that simply does not match their meaning.  Run-on sentences are bad when
> they are too frequent, but made much worse by your overuse of "filler"
> words and phrases.  Much of what you write would be more appropriate for
> a politician giving a filibuster speech.
>
> The root problem, I think, is that you have no focus in your writing.
> There is an open conduct between your thoughts and the words you type.
> Your thoughts wander, and - like everyone else - /you/ understand what
> you are thinking about.  But other people do not live in your head.  If
> you want people to understand what you are thinking about, you have to
> write in a way that other people can understand it - not just throw your
> thoughts at a page randomly.
>
> I believe you have things worth saying.  That's why I am trying to
> suggest how you can improve your communication skills.  Many others just
> write your posts off as "gobbledegook" or ignore them entirely.  (The
> number of people that have given such feedback should be an indication
> that the problem here is the writer, not the readers.)
>
> This will, I think, be the last post I make directly to you (at least
> for a while) - unless you specifically ask for something.  If you
> understand what I am trying to say, and appreciate that you have a
> serious problem communicating, then you can do something about it.  If
> you don't think that is the case, then you will continue to write posts
> that are mostly ignored because they are simply too much effort to read.
>


Hm. Why, then, thank you good sir, such constructive criticism is
estimated a fair and forthright or the conscientious opinion.

That said, I'll yet aver that my command of the concepts is
very strong, and it's toward, for example, "Grice", "Grice's maxims",
of communication, or for example typical accounts of, "effective
communication", vis-a-vis ethos and pathos and kairos here the _logos_,
and not mambly-pambly sorts manager-speak, nor "control freaks",
I'll aver that the more you know the better it goes.


Thanks for writing.

If I may, I'd then ask "are there any questions or perceived
paradoxes or estimated particulars of incorrectness that it
may help to clarify?"


Some people prefer questions or the pointed, others a sort
of tendered reserve, implying invitation to remarks, then
as to whether, if I suggest that I _would_ ask, is that asking?


That said, then in an obligatory manner about logical statement
and parenthesis, has that precedence is most commonly C and C++'s
vis-a-vis, for example Java's _few_ differences in precedence
of priority of evaluation of operators their expressions in expressions,
and never hurts, except for readability when
it's obvious both the intent and the meaning.

Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1588
Author: Richard Harnden
Date: Mon, 16 Nov 2026 19:16
179 lines
9713 bytes
On 16/11/2026 16:33, Ross Finlayson wrote:
> On 11/16/2026 06:04 AM, David Brown wrote:
>> On 16/11/2026 12:57, Ross Finlayson wrote:
>>> On 11/16/2026 03:37 AM, David Brown wrote:
>>>> On 16/11/2026 11:21, Ross Finlayson wrote:
>>>>>
>>>>> One way to read what your saying is "algebraizations" and
>>>>> "arithmetizations", that's the act of interpreting models of
>>>>> objects their matters of relation according to the matters of
>>>>> relation of algebras and arithmetic.
>>>>>
>>>> No, that is not a way to read what I wrote.  I wrote in English.
>>>>
>>>> Please find some way to write comprehensibly, without the waffling and
>>>> rambling, and focusing on the point you are trying to make.
>>>>
>>>> Maybe you could try this for a plan.  Before hitting "send" on a post,
>>>> give the post to your favourite AI slopbot and ask it to generate a
>>>> single paragraph summary.  If that summary does not match what you
>>>> wanted to say, you know you need to express your post differently.  And
>>>> if it /does/ match what you want to say, just post that summary so that
>>>> other people don't need to wade through your original post.
>>>>
>>>
>>> I dispute your estimation of my command of English.
>>>
>>> Wherever you got the impression that what I write
>>> isn't perfectly grammatical, if long-winded and
>>> for some a bit the too run-on the style, forget it.
>>>
>>> Of course above where I wrote "your" for "you're",
>>> that's intolerable.
>>
>>
>> Your grammar is imperfect, but not nearly bad enough to be an issue.
>> Real problems include your regular use of words and phrases in a way
>> that simply does not match their meaning.  Run-on sentences are bad when
>> they are too frequent, but made much worse by your overuse of "filler"
>> words and phrases.  Much of what you write would be more appropriate for
>> a politician giving a filibuster speech.
>>
>> The root problem, I think, is that you have no focus in your writing.
>> There is an open conduct between your thoughts and the words you type.
>> Your thoughts wander, and - like everyone else - /you/ understand what
>> you are thinking about.  But other people do not live in your head.  If
>> you want people to understand what you are thinking about, you have to
>> write in a way that other people can understand it - not just throw your
>> thoughts at a page randomly.
>>
>> I believe you have things worth saying.  That's why I am trying to
>> suggest how you can improve your communication skills.  Many others just
>> write your posts off as "gobbledegook" or ignore them entirely.  (The
>> number of people that have given such feedback should be an indication
>> that the problem here is the writer, not the readers.)
>>
>> This will, I think, be the last post I make directly to you (at least
>> for a while) - unless you specifically ask for something.  If you
>> understand what I am trying to say, and appreciate that you have a
>> serious problem communicating, then you can do something about it.  If
>> you don't think that is the case, then you will continue to write posts
>> that are mostly ignored because they are simply too much effort to read.
>>
> 
> 
> Hm. Why, then, thank you good sir, such constructive criticism is
> estimated a fair and forthright or the conscientious opinion.
> 
> That said, I'll yet aver that my command of the concepts is
> very strong, and it's toward, for example, "Grice", "Grice's maxims",
> of communication, or for example typical accounts of, "effective
> communication", vis-a-vis ethos and pathos and kairos here the _logos_,
> and not mambly-pambly sorts manager-speak, nor "control freaks",
> I'll aver that the more you know the better it goes.
> 
> 
> Thanks for writing.
> 
> If I may, I'd then ask "are there any questions or perceived
> paradoxes or estimated particulars of incorrectness that it
> may help to clarify?"
> 
> 
> Some people prefer questions or the pointed, others a sort
> of tendered reserve, implying invitation to remarks, then
> as to whether, if I suggest that I _would_ ask, is that asking?
> 
> 
> That said, then in an obligatory manner about logical statement
> and parenthesis, has that precedence is most commonly C and C++'s
> vis-a-vis, for example Java's _few_ differences in precedence
> of priority of evaluation of operators their expressions in expressions,
> and never hurts, except for readability when
> it's obvious both the intent and the meaning.
> 
> 

[There's really no reason to read this.  I'm sorry ...]

Me:
How do I do list comprehensions in C?

ChatGPT:
[reasonable answer]

Me:
Thanks, but I want the question to be far more verbose.  Maybe with more 
keywords (even if they're not relevant).  Basically I want lots of 
waffle - even if it makes me sound like an idiot.

ChatGTP:
Ah, I see!

You don't just want to ask how to implement Python-style list 
comprehensions in C. You want to wrap the question in an impressive 
amount of unnecessarily complicated technical terminology, preferably 
making a relatively straightforward programming problem sound like a 
major software architecture challenge.

I can certainly help with that. 😂

Here's a suitably over-engineered version:

I'm interested in exploring the possibility of implementing a mechanism 
within the C programming language that provides functionality 
conceptually analogous to Python's list comprehension syntax.
More specifically, I'm looking at whether it's possible to introduce a 
declarative approach to collection construction and transformation, 
allowing the generation of derived data structures through the 
application of expressions, conditional predicates, iteration strategies 
and potentially nested evaluation constructs.

Ideally, I'd like to investigate whether this could be achieved using 
some combination of preprocessor macros, generic programming techniques, 
function pointers, callback mechanisms, higher-order abstractions and 
possibly C11 language features.

I'm particularly interested in understanding how such an implementation 
might facilitate operations equivalent to mapping, filtering, 
projection, selection and aggregation, while minimising unnecessary 
boilerplate and maintaining reasonable levels of type safety, memory 
management discipline and runtime efficiency.

It would also be interesting to consider whether a lightweight 
abstraction layer could provide a more expressive, 
functional-programming-inspired interface without fundamentally 
compromising the procedural nature, portability or performance 
characteristics of conventional C.

Are there any established design patterns, implementation strategies or 
library-level approaches that would lend themselves to this kind of 
functionality? I'd also be interested in any potential limitations 
imposed by the language's lack of native closure support, dynamic typing 
and built-in collection abstractions.

And if you really want to go overboard, here's a suggested opening sentence:
"I am seeking to investigate the feasibility of introducing a 
Python-inspired, declarative, functional-style collection transformation 
paradigm into an otherwise predominantly imperative, statically typed, 
low-level systems programming environment."

There. You've turned "How do I do list comprehensions in C?" into 
something that sounds like a six-month research project with a steering 
committee. 😁

Me:
Excellent, thank you

ChatGPT:
You're very welcome! 😁

Always happy to turn a perfectly sensible programming question into an 
unnecessarily complicated technical specification.

It's practically an art form. 😂

[Sorry again.  I shall now crawl back under my rock.]


Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1590
Author: Ross Finlayson
Date: Mon, 16 Nov 2026 19:52
190 lines
10261 bytes
On 11/16/2026 11:16 AM, Richard Harnden wrote:
> On 16/11/2026 16:33, Ross Finlayson wrote:
>> On 11/16/2026 06:04 AM, David Brown wrote:
>>> On 16/11/2026 12:57, Ross Finlayson wrote:
>>>> On 11/16/2026 03:37 AM, David Brown wrote:
>>>>> On 16/11/2026 11:21, Ross Finlayson wrote:
>>>>>>
>>>>>> One way to read what your saying is "algebraizations" and
>>>>>> "arithmetizations", that's the act of interpreting models of
>>>>>> objects their matters of relation according to the matters of
>>>>>> relation of algebras and arithmetic.
>>>>>>
>>>>> No, that is not a way to read what I wrote.  I wrote in English.
>>>>>
>>>>> Please find some way to write comprehensibly, without the waffling and
>>>>> rambling, and focusing on the point you are trying to make.
>>>>>
>>>>> Maybe you could try this for a plan.  Before hitting "send" on a post,
>>>>> give the post to your favourite AI slopbot and ask it to generate a
>>>>> single paragraph summary.  If that summary does not match what you
>>>>> wanted to say, you know you need to express your post differently.
>>>>> And
>>>>> if it /does/ match what you want to say, just post that summary so
>>>>> that
>>>>> other people don't need to wade through your original post.
>>>>>
>>>>
>>>> I dispute your estimation of my command of English.
>>>>
>>>> Wherever you got the impression that what I write
>>>> isn't perfectly grammatical, if long-winded and
>>>> for some a bit the too run-on the style, forget it.
>>>>
>>>> Of course above where I wrote "your" for "you're",
>>>> that's intolerable.
>>>
>>>
>>> Your grammar is imperfect, but not nearly bad enough to be an issue.
>>> Real problems include your regular use of words and phrases in a way
>>> that simply does not match their meaning.  Run-on sentences are bad when
>>> they are too frequent, but made much worse by your overuse of "filler"
>>> words and phrases.  Much of what you write would be more appropriate for
>>> a politician giving a filibuster speech.
>>>
>>> The root problem, I think, is that you have no focus in your writing.
>>> There is an open conduct between your thoughts and the words you type.
>>> Your thoughts wander, and - like everyone else - /you/ understand what
>>> you are thinking about.  But other people do not live in your head.  If
>>> you want people to understand what you are thinking about, you have to
>>> write in a way that other people can understand it - not just throw your
>>> thoughts at a page randomly.
>>>
>>> I believe you have things worth saying.  That's why I am trying to
>>> suggest how you can improve your communication skills.  Many others just
>>> write your posts off as "gobbledegook" or ignore them entirely.  (The
>>> number of people that have given such feedback should be an indication
>>> that the problem here is the writer, not the readers.)
>>>
>>> This will, I think, be the last post I make directly to you (at least
>>> for a while) - unless you specifically ask for something.  If you
>>> understand what I am trying to say, and appreciate that you have a
>>> serious problem communicating, then you can do something about it.  If
>>> you don't think that is the case, then you will continue to write posts
>>> that are mostly ignored because they are simply too much effort to read.
>>>
>>
>>
>> Hm. Why, then, thank you good sir, such constructive criticism is
>> estimated a fair and forthright or the conscientious opinion.
>>
>> That said, I'll yet aver that my command of the concepts is
>> very strong, and it's toward, for example, "Grice", "Grice's maxims",
>> of communication, or for example typical accounts of, "effective
>> communication", vis-a-vis ethos and pathos and kairos here the _logos_,
>> and not mambly-pambly sorts manager-speak, nor "control freaks",
>> I'll aver that the more you know the better it goes.
>>
>>
>> Thanks for writing.
>>
>> If I may, I'd then ask "are there any questions or perceived
>> paradoxes or estimated particulars of incorrectness that it
>> may help to clarify?"
>>
>>
>> Some people prefer questions or the pointed, others a sort
>> of tendered reserve, implying invitation to remarks, then
>> as to whether, if I suggest that I _would_ ask, is that asking?
>>
>>
>> That said, then in an obligatory manner about logical statement
>> and parenthesis, has that precedence is most commonly C and C++'s
>> vis-a-vis, for example Java's _few_ differences in precedence
>> of priority of evaluation of operators their expressions in expressions,
>> and never hurts, except for readability when
>> it's obvious both the intent and the meaning.
>>
>>
>
> [There's really no reason to read this.  I'm sorry ...]
>
> Me:
> How do I do list comprehensions in C?
>
> ChatGPT:
> [reasonable answer]
>
> Me:
> Thanks, but I want the question to be far more verbose.  Maybe with more
> keywords (even if they're not relevant).  Basically I want lots of
> waffle - even if it makes me sound like an idiot.
>
> ChatGTP:
> Ah, I see!
>
> You don't just want to ask how to implement Python-style list
> comprehensions in C. You want to wrap the question in an impressive
> amount of unnecessarily complicated technical terminology, preferably
> making a relatively straightforward programming problem sound like a
> major software architecture challenge.
>
> I can certainly help with that. 😂
>
> Here's a suitably over-engineered version:
>
> I'm interested in exploring the possibility of implementing a mechanism
> within the C programming language that provides functionality
> conceptually analogous to Python's list comprehension syntax.
> More specifically, I'm looking at whether it's possible to introduce a
> declarative approach to collection construction and transformation,
> allowing the generation of derived data structures through the
> application of expressions, conditional predicates, iteration strategies
> and potentially nested evaluation constructs.
>
> Ideally, I'd like to investigate whether this could be achieved using
> some combination of preprocessor macros, generic programming techniques,
> function pointers, callback mechanisms, higher-order abstractions and
> possibly C11 language features.
>
> I'm particularly interested in understanding how such an implementation
> might facilitate operations equivalent to mapping, filtering,
> projection, selection and aggregation, while minimising unnecessary
> boilerplate and maintaining reasonable levels of type safety, memory
> management discipline and runtime efficiency.
>
> It would also be interesting to consider whether a lightweight
> abstraction layer could provide a more expressive,
> functional-programming-inspired interface without fundamentally
> compromising the procedural nature, portability or performance
> characteristics of conventional C.
>
> Are there any established design patterns, implementation strategies or
> library-level approaches that would lend themselves to this kind of
> functionality? I'd also be interested in any potential limitations
> imposed by the language's lack of native closure support, dynamic typing
> and built-in collection abstractions.
>
> And if you really want to go overboard, here's a suggested opening
> sentence:
> "I am seeking to investigate the feasibility of introducing a
> Python-inspired, declarative, functional-style collection transformation
> paradigm into an otherwise predominantly imperative, statically typed,
> low-level systems programming environment."
>
> There. You've turned "How do I do list comprehensions in C?" into
> something that sounds like a six-month research project with a steering
> committee. 😁
>
> Me:
> Excellent, thank you
>
> ChatGPT:
> You're very welcome! 😁
>
> Always happy to turn a perfectly sensible programming question into an
> unnecessarily complicated technical specification.
>
> It's practically an art form. 😂
>
> [Sorry again.  I shall now crawl back under my rock.]
>
>
>

"Can it use _Generic from C11 to result the eventual evaluation
is implicitly and strongly typed?"

"Shouldn't it be called _deferred_ or _suspended_ "comprehension"?"

Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1597
Author: James Kuyper
Date: Mon, 16 Nov 2026 21:09
12 lines
2337 bytes
On 2026-11-16 06:57, Ross Finlayson wrote:
...> I dispute your estimation of my command of English.
> 
> Wherever you got the impression that what I write
> isn't perfectly grammatical, if long-winded and
> for some a bit the too run-on the style, forget it.
He got that impression directly by reading what you've written. That
makes "forget it" a hard piece of advice to follow.
I haven't made as big of an effort to understand what you're saying as
David has; and as a result, I've had even less success. It's not
primarily a matter of bad grammar, but of lack of organization and
unclear wording.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1601
Author: Keith Thompson
Date: Mon, 16 Nov 2026 23:17
30 lines
3049 bytes
Ross Finlayson <ross.a.finlayson@gmail.com> writes:
[...]
> That said, I'll yet aver that my command of the concepts is
> very strong, and it's toward, for example, "Grice", "Grice's maxims",
> of communication, or for example typical accounts of, "effective
> communication", vis-a-vis ethos and pathos and kairos here the _logos_,
> and not mambly-pambly sorts manager-speak, nor "control freaks",
> I'll aver that the more you know the better it goes.
[...]

This is exactly the kind of writing style that makes it difficult,
and frankly not worth the effort, to understand what you're saying.

Perhaps you assume that people know about "Grice's maxims".  I *think*
I had heard of them.  Looking them up just now, I find that they're a
set of principles for clear and cooperative communication.  You seem
to prioritize deliberate obscurity over clarity and informativeness.

Consider the fact that multiple people here have criticized your
writing style, and I'm fairly sure nobody has said anything good
about it.

And while I can't be sure, I don't believe you've written anything
interesting enough to be worth the effort of decoding it.

Don't feel obligated to reply to this.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1606
Author: Ross Finlayson
Date: Tue, 17 Nov 2026 08:52
116 lines
7535 bytes
On 11/16/2026 03:17 PM, Keith Thompson wrote:
> Ross Finlayson <ross.a.finlayson@gmail.com> writes:
> [...]
>> That said, I'll yet aver that my command of the concepts is
>> very strong, and it's toward, for example, "Grice", "Grice's maxims",
>> of communication, or for example typical accounts of, "effective
>> communication", vis-a-vis ethos and pathos and kairos here the _logos_,
>> and not mambly-pambly sorts manager-speak, nor "control freaks",
>> I'll aver that the more you know the better it goes.
> [...]
>
> This is exactly the kind of writing style that makes it difficult,
> and frankly not worth the effort, to understand what you're saying.
>
> Perhaps you assume that people know about "Grice's maxims".  I *think*
> I had heard of them.  Looking them up just now, I find that they're a
> set of principles for clear and cooperative communication.  You seem
> to prioritize deliberate obscurity over clarity and informativeness.
>
> Consider the fact that multiple people here have criticized your
> writing style, and I'm fairly sure nobody has said anything good
> about it.
>
> And while I can't be sure, I don't believe you've written anything
> interesting enough to be worth the effort of decoding it.
>
> Don't feel obligated to reply to this.
>

I blame Wittgenstein, and the Whorfian. So, Wittgenstein was a
"philosopher", and Whorf, a "linguist". And what they say is
that nobody understands anybody. I disagree with this.
(And others do, too.)

Then for example there are accounts of grammar. We all know Chomsky
grammars from computer science, but we all learned Tesniere grammars
in natural language class. They're quite competing accounts.

Grice is basically a reading "The Golden Rule" for language,
"The Golden Rule" has a variety of phrasings, "The Golden Rule",
"The Golden Rules", "The Silver Rule", is basically an account
of "conscientiousness" and "co-operation".

In physics for example there's "shut up and compute".
Yet, that's after accounts of "reductionism", like
"the severe abstraction of the mechanical reduction",
about then that, for example, Lienard-Wiechert's "electron-holes",
are solid-state physics' "Fermi holes", which have more character
than the account of the test charge a point-particle as bodies.

Then, "in the language", always has a wider context. There's
the, "invincible ignorance of inductive inference", that
according to inductive inference, is invincible, yet according
to a wider account of deductive inference, is ignorant.


Then, here, for example, about C and C++, has that C++ has
constructs, "in the language", i.e., according to syntax,
what in C, need to be built as constructs, for example about
implementing variant types in C to make a model of polymorphic
types as C++ already provides. So, from one point-of-view,
they don't exist, in the other, they do. Yet, after account
of comprehending them the _models_, about model theory,
the _structures_, in structured programming, then it's
all one wider language, with _examples_ of the accouts
of what were the _worlds_ of their own accounts, as like
the "internally self-consistent", vis-a-vis, their union.


So, one language's syntax is another's semantics, and vice-versa.


Here for example about precedence/priority and the parenthetical
establishing nesting in what otherwise would the sequential,
about the operations, there's _common syntax_ what for _common
types_ have _common semantics_, they're "the same language",
C and C++, which follows C's. Yet, C++ has "operator overloading",
then it depends on algebraizations of arithmetizations, whether
_all the semantics of arithmetic_, are maintained, in the algebraization
of the arithmetization of C++ in the language
over-loading operators. For example, where they're not, then
"one language's is another's semantics, and vice-versa".
This contrasts with the usual _boundary between syntax and semantics,
that syntax is syntax and semantics is semantics, for whatever
they say the same thing (when they don't).


So, that being topical or relevant, or for Grice which now
we both know, to "does an expression in a logical statement
need parentheses for proper evaluation", is that since both
C and C++ have always the same rules for the syntax, that
"if it does, it does", yet it depends on the actual algebraization
and arithmetization, which is usually implicit, whether the objects
of the algebra model the objects of the arithmetic, and vice-versa,
thus that all the possible derivations, are also well-defined,
where they are or aren't.



Then, in the other thread about "components in C++", where
for example "library author's are responsible for re-usable
code" then "component framework provider's are responsible
for re-usable libraries", as a sort of definition, has for
example that C++ already has a way for this, about what
patterns of the patternry/"module-ry"/componentry, make
that simple, _including modeling the error-handling and
the exception-modeling_, and working that up to what accounts
of strong types that C _does_ have, basically is about other
languages than C/C++, and accounts of features they've had for
a long time, how to design and build those in C and compatible
with C++, for example about reflection-based metaprogramming
or component frameworks like OLE/COM, what simply don't otherwise
already have accounts "in the language", yet do, "in the wider language".


Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1608
Author: Ross Finlayson
Date: Tue, 17 Nov 2026 09:17
151 lines
9168 bytes
On 11/17/2026 12:52 AM, Ross Finlayson wrote:
> On 11/16/2026 03:17 PM, Keith Thompson wrote:
>> Ross Finlayson <ross.a.finlayson@gmail.com> writes:
>> [...]
>>> That said, I'll yet aver that my command of the concepts is
>>> very strong, and it's toward, for example, "Grice", "Grice's maxims",
>>> of communication, or for example typical accounts of, "effective
>>> communication", vis-a-vis ethos and pathos and kairos here the _logos_,
>>> and not mambly-pambly sorts manager-speak, nor "control freaks",
>>> I'll aver that the more you know the better it goes.
>> [...]
>>
>> This is exactly the kind of writing style that makes it difficult,
>> and frankly not worth the effort, to understand what you're saying.
>>
>> Perhaps you assume that people know about "Grice's maxims".  I *think*
>> I had heard of them.  Looking them up just now, I find that they're a
>> set of principles for clear and cooperative communication.  You seem
>> to prioritize deliberate obscurity over clarity and informativeness.
>>
>> Consider the fact that multiple people here have criticized your
>> writing style, and I'm fairly sure nobody has said anything good
>> about it.
>>
>> And while I can't be sure, I don't believe you've written anything
>> interesting enough to be worth the effort of decoding it.
>>
>> Don't feel obligated to reply to this.
>>
>
> I blame Wittgenstein, and the Whorfian. So, Wittgenstein was a
> "philosopher", and Whorf, a "linguist". And what they say is
> that nobody understands anybody. I disagree with this.
> (And others do, too.)
>
> Then for example there are accounts of grammar. We all know Chomsky
> grammars from computer science, but we all learned Tesniere grammars
> in natural language class. They're quite competing accounts.
>
> Grice is basically a reading "The Golden Rule" for language,
> "The Golden Rule" has a variety of phrasings, "The Golden Rule",
> "The Golden Rules", "The Silver Rule", is basically an account
> of "conscientiousness" and "co-operation".
>
> In physics for example there's "shut up and compute".
> Yet, that's after accounts of "reductionism", like
> "the severe abstraction of the mechanical reduction",
> about then that, for example, Lienard-Wiechert's "electron-holes",
> are solid-state physics' "Fermi holes", which have more character
> than the account of the test charge a point-particle as bodies.
>
> Then, "in the language", always has a wider context. There's
> the, "invincible ignorance of inductive inference", that
> according to inductive inference, is invincible, yet according
> to a wider account of deductive inference, is ignorant.
>
>
> Then, here, for example, about C and C++, has that C++ has
> constructs, "in the language", i.e., according to syntax,
> what in C, need to be built as constructs, for example about
> implementing variant types in C to make a model of polymorphic
> types as C++ already provides. So, from one point-of-view,
> they don't exist, in the other, they do. Yet, after account
> of comprehending them the _models_, about model theory,
> the _structures_, in structured programming, then it's
> all one wider language, with _examples_ of the accouts
> of what were the _worlds_ of their own accounts, as like
> the "internally self-consistent", vis-a-vis, their union.
>
>
> So, one language's syntax is another's semantics, and vice-versa.
>
>
> Here for example about precedence/priority and the parenthetical
> establishing nesting in what otherwise would the sequential,
> about the operations, there's _common syntax_ what for _common
> types_ have _common semantics_, they're "the same language",
> C and C++, which follows C's. Yet, C++ has "operator overloading",
> then it depends on algebraizations of arithmetizations, whether
> _all the semantics of arithmetic_, are maintained, in the algebraization
> of the arithmetization of C++ in the language
> over-loading operators. For example, where they're not, then
> "one language's is another's semantics, and vice-versa".
> This contrasts with the usual _boundary between syntax and semantics,
> that syntax is syntax and semantics is semantics, for whatever
> they say the same thing (when they don't).
>
>
> So, that being topical or relevant, or for Grice which now
> we both know, to "does an expression in a logical statement
> need parentheses for proper evaluation", is that since both
> C and C++ have always the same rules for the syntax, that
> "if it does, it does", yet it depends on the actual algebraization
> and arithmetization, which is usually implicit, whether the objects
> of the algebra model the objects of the arithmetic, and vice-versa,
> thus that all the possible derivations, are also well-defined,
> where they are or aren't.
>
>
>
> Then, in the other thread about "components in C++", where
> for example "library author's are responsible for re-usable
> code" then "component framework provider's are responsible
> for re-usable libraries", as a sort of definition, has for
> example that C++ already has a way for this, about what
> patterns of the patternry/"module-ry"/componentry, make
> that simple, _including modeling the error-handling and
> the exception-modeling_, and working that up to what accounts
> of strong types that C _does_ have, basically is about other
> languages than C/C++, and accounts of features they've had for
> a long time, how to design and build those in C and compatible
> with C++, for example about reflection-based metaprogramming
> or component frameworks like OLE/COM, what simply don't otherwise
> already have accounts "in the language", yet do, "in the wider language".
>
>
>

"Does an expression in a logical statement need never-quotes
for proper evaluation?"

That's about stuff like "quoting contexts" and for example
"the arithmo-Quine".

One account of Tarski his efforts was about resulting logics
that were "constant-free" or "parameter-free". So, that's
also relevant to these sorts of accounts like "bit-flags"
or any otherwise representation of logically _objects_,
by _bits_. So, those bits, as representations, are only
logical _in their intepretive setting_, otherwise they're
just bits. So, it's exercises in "model theory" what make
_examples_ of interpretive settings, like for example the
definition given by what result "formal" accounts of "closed"
languages like C and C++ or otherwise programming languages,
why the source code always has an _identifier_, then as with
regards to the algebraization the arithmetization on the _machine_,
results the same. They always have identifiers, even after
the compilation for the runtime results the, "identifier-free",
which for example then is built up to conventions of "symbols".

It's like ASCII, or for example Unicode:
without the table, and relating that
to allll the natural languages in the world
(covered by those alphabets):
it's just bits.

(Bits, binary-digits, "binits", ....)



Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1610
Author: Keith Thompson
Date: Tue, 17 Nov 2026 21:53
56 lines
4426 bytes
Ross Finlayson <ross.a.finlayson@gmail.com> writes:
> On 11/16/2026 03:17 PM, Keith Thompson wrote:
>> Ross Finlayson <ross.a.finlayson@gmail.com> writes:
>> [...]
>>> That said, I'll yet aver that my command of the concepts is
>>> very strong, and it's toward, for example, "Grice", "Grice's maxims",
>>> of communication, or for example typical accounts of, "effective
>>> communication", vis-a-vis ethos and pathos and kairos here the _logos_,
>>> and not mambly-pambly sorts manager-speak, nor "control freaks",
>>> I'll aver that the more you know the better it goes.
>> [...]
>>
>> This is exactly the kind of writing style that makes it difficult,
>> and frankly not worth the effort, to understand what you're saying.
>>
>> Perhaps you assume that people know about "Grice's maxims".  I *think*
>> I had heard of them.  Looking them up just now, I find that they're a
>> set of principles for clear and cooperative communication.  You seem
>> to prioritize deliberate obscurity over clarity and informativeness.
>>
>> Consider the fact that multiple people here have criticized your
>> writing style, and I'm fairly sure nobody has said anything good
>> about it.
>>
>> And while I can't be sure, I don't believe you've written anything
>> interesting enough to be worth the effort of decoding it.
>>
>> Don't feel obligated to reply to this.
>
> I blame Wittgenstein, and the Whorfian. So, Wittgenstein was a
> "philosopher", and Whorf, a "linguist". And what they say is
> that nobody understands anybody. I disagree with this.
> (And others do, too.)
[82 lines deleted]

Ross, do you understand that the vast majority of other readers in
this newsgroup *don't know what you're talking about*?

Perhaps you're being very clever in your writing, but the net effect
is that you're posting large volumes of what most or all of us
see as word salad.  This isn't about philosophy or linguistics.
It's about *you* using an impenetrable writing style and wasting
everyone's time.  That's your fault, not anyone else's.

And your long discourses about linguistics are off-topic in newsgroups
where we discuss the C and C++ programming languages.

Try reading some other articles that have been posted here, and
that have been part of meaninful discussions.  Consider trying to
emulate the style of those articles -- *if* you want to talk about
C and C++.  If you want to talk about something other than C and C++,
please don't do it here.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1614
Author: Ross Finlayson
Date: Wed, 18 Nov 2026 00:26
148 lines
9043 bytes
On 11/17/2026 01:53 PM, Keith Thompson wrote:
> Ross Finlayson <ross.a.finlayson@gmail.com> writes:
>> On 11/16/2026 03:17 PM, Keith Thompson wrote:
>>> Ross Finlayson <ross.a.finlayson@gmail.com> writes:
>>> [...]
>>>> That said, I'll yet aver that my command of the concepts is
>>>> very strong, and it's toward, for example, "Grice", "Grice's maxims",
>>>> of communication, or for example typical accounts of, "effective
>>>> communication", vis-a-vis ethos and pathos and kairos here the _logos_,
>>>> and not mambly-pambly sorts manager-speak, nor "control freaks",
>>>> I'll aver that the more you know the better it goes.
>>> [...]
>>>
>>> This is exactly the kind of writing style that makes it difficult,
>>> and frankly not worth the effort, to understand what you're saying.
>>>
>>> Perhaps you assume that people know about "Grice's maxims".  I *think*
>>> I had heard of them.  Looking them up just now, I find that they're a
>>> set of principles for clear and cooperative communication.  You seem
>>> to prioritize deliberate obscurity over clarity and informativeness.
>>>
>>> Consider the fact that multiple people here have criticized your
>>> writing style, and I'm fairly sure nobody has said anything good
>>> about it.
>>>
>>> And while I can't be sure, I don't believe you've written anything
>>> interesting enough to be worth the effort of decoding it.
>>>
>>> Don't feel obligated to reply to this.
>>
>> I blame Wittgenstein, and the Whorfian. So, Wittgenstein was a
>> "philosopher", and Whorf, a "linguist". And what they say is
>> that nobody understands anybody. I disagree with this.
>> (And others do, too.)
> [82 lines deleted]
>
> Ross, do you understand that the vast majority of other readers in
> this newsgroup *don't know what you're talking about*?
>
> Perhaps you're being very clever in your writing, but the net effect
> is that you're posting large volumes of what most or all of us
> see as word salad.  This isn't about philosophy or linguistics.
> It's about *you* using an impenetrable writing style and wasting
> everyone's time.  That's your fault, not anyone else's.
>
> And your long discourses about linguistics are off-topic in newsgroups
> where we discuss the C and C++ programming languages.
>
> Try reading some other articles that have been posted here, and
> that have been part of meaninful discussions.  Consider trying to
> emulate the style of those articles -- *if* you want to talk about
> C and C++.  If you want to talk about something other than C and C++,
> please don't do it here.
>


Thanks for writing, Keith. To be sure, if there was "offense", or,
you know, "hurt", none was meant, in this case. It's not considered
an affront to be talkative on open forae, "in the spirit of the
charter", say.

Since we are neither pseudonymizing trolls nor sockpuppet-bots,
either of which lies in transgression of the charter, then in
speaking to "comp.lang.c" and "comp.lang.c++", it's well expected
that first of all most-everybody knows most-everything about these
languages, if not necessarily of similar or even equivalent experience,
then when we talk about, for example, "C11" and "C++11", then it's
beyond the surface and as well from many perspectival accounts.

It's not for example necessarily "the standards working groups",
vis-a-vis something like "comp.lang.c++.moderated", which last
it says was looking for a moderator, that we self-regular and
moderate ourselves, including with such gentle remonstrances
as you and others provide, helping express sentiment and reaction,
as part of "letters" and here "belles lettres" and so on.

So, first of all, we all know pretty much anything about C and C++,
or it's readily recounted, and to see it's "known" is as we can
read it as we see it, relate it to the standard and formal accounts,
it all makes sense, these are each languages with their syntax and
semantics about the guarantees and behavior, it's the way of the
things. Then, each has their _own_ account, sums of their influences
and state of their consciousness, the many and manifold things.


So, then to talking about C and C++, first of all is that here
it's pretty much: "C/C++". There've long been def'd or ndef'd
the _cplusplus macro and "extern "C"", it's C/C++ with regards
to both their languages, together "C/C++", then for example with
"C11" for the .h/.c files and "C++11" for the .h/.hpp/.cpp/.cxx/...
C++ files, the sources, according to the compilers, or in all
respect to "GCC", vis-a-vis "g++", "gcc", and C and C++.


We all know all this, it's no big deal.


Then there's that requirement or preference (or inheritance,
often enough) has that some code is C and some code is C++
without C (though, often enough it "is" also "legal in C"),
then various accounts of standards have some people are sticklers
(like for "C99/C++03", some with C++ 08 or 11 or 20 or 23, or what
it is) and some are slackers ("it compiles"), and others, euh,
"stagers", always with the latest bleeding-edge features of the
language since it's not relevant "stability" or that various
accounts of "simplicity" talk past each other. It varies.


Here then for example, what I'm trying to figure out is basically
how to make for C what's in C++ without being in C++ that's yet
readily adaptable for calling and being called from and into C++
from C. Like, for example, "sequence" or "iter", and "lister"
and the like, then for something like "C11 _Generic", making accounts
of generics the types in C vis-a-vis the polymorphic class model
in C++, about "sized" or accounts like "characteristics" of access
of arrays, pointer-offsets, lists, otherwise the usual things,
"holders", "getters and setters", then about "libraries" and
"components", after things like "success_t, error_t, and return_t,
for context_t", definitions of the patterns, that would be generally
suitable for writing libraries in C and having them callable and
calling to and from C++, these are the kinds of things I'm liking
to figure out.


Like for example about how to pass an allocator into C, or making
access of ctx_new/ctx_del or ctx_init/ctx_fini, those being about
storage or lifetime and ownership and responsibility, then for
things like "emit_log" and "emit_metric" and "emit_dump", these
are the kinds of things that later always live in any sort of
application framework, for making good-style.



Parentheses are generally useful in expressions since if they're
nested so deep as to become cumbersome, that's too much on one line.
People are yet expected to be familiar and immediately recognize
accounts like "star-p and post-increment", "the C idiom" (for iterators
and matching iterators), then about: getting _above_ that stuff,
yet, not too high.



Warm, i.e., warm regards.




Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1615
Author: Chris M. Thomasson
Date: Wed, 18 Nov 2026 01:00
12 lines
2401 bytes
On 11/17/2026 4:26 PM, Ross Finlayson wrote:
[...]
> Thanks for writing, Keith. To be sure, if there was "offense", or,
> you know, "hurt", none was meant, in this case. It's not considered
> an affront to be talkative on open forae, "in the spirit of the
> charter", say.

That's cool, but wow! You have the gift of creating the best salads out 
there... ;^)


[....]
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1616
Author: Keith Thompson
Date: Wed, 18 Nov 2026 01:56
93 lines
5831 bytes
Ross Finlayson <ross.a.finlayson@gmail.com> writes:
> On 11/17/2026 01:53 PM, Keith Thompson wrote:
>> Ross Finlayson <ross.a.finlayson@gmail.com> writes:
>>> On 11/16/2026 03:17 PM, Keith Thompson wrote:
>>>> Ross Finlayson <ross.a.finlayson@gmail.com> writes:
>>>> [...]
>>>>> That said, I'll yet aver that my command of the concepts is
>>>>> very strong, and it's toward, for example, "Grice", "Grice's maxims",
>>>>> of communication, or for example typical accounts of, "effective
>>>>> communication", vis-a-vis ethos and pathos and kairos here the _logos_,
>>>>> and not mambly-pambly sorts manager-speak, nor "control freaks",
>>>>> I'll aver that the more you know the better it goes.
>>>> [...]
>>>>
>>>> This is exactly the kind of writing style that makes it difficult,
>>>> and frankly not worth the effort, to understand what you're saying.
>>>>
>>>> Perhaps you assume that people know about "Grice's maxims".  I *think*
>>>> I had heard of them.  Looking them up just now, I find that they're a
>>>> set of principles for clear and cooperative communication.  You seem
>>>> to prioritize deliberate obscurity over clarity and informativeness.
>>>>
>>>> Consider the fact that multiple people here have criticized your
>>>> writing style, and I'm fairly sure nobody has said anything good
>>>> about it.
>>>>
>>>> And while I can't be sure, I don't believe you've written anything
>>>> interesting enough to be worth the effort of decoding it.
>>>>
>>>> Don't feel obligated to reply to this.
>>>
>>> I blame Wittgenstein, and the Whorfian. So, Wittgenstein was a
>>> "philosopher", and Whorf, a "linguist". And what they say is
>>> that nobody understands anybody. I disagree with this.
>>> (And others do, too.)
>> [82 lines deleted]
>>
>> Ross, do you understand that the vast majority of other readers in
>> this newsgroup *don't know what you're talking about*?

That question was not rhetorical.  I'd like you to answer it with a
"yes" or "no".

[...]

> Thanks for writing, Keith. To be sure, if there was "offense", or,
> you know, "hurt", none was meant, in this case. It's not considered
> an affront to be talkative on open forae, "in the spirit of the
> charter", say.

Your writing does not offend me.  It bores me.

[snip]

> So, first of all, we all know pretty much anything about C and C++,
> or it's readily recounted, and to see it's "known" is as we can
> read it as we see it, relate it to the standard and formal accounts,
> it all makes sense, these are each languages with their syntax and
> semantics about the guarantees and behavior, it's the way of the
> things. Then, each has their _own_ account, sums of their influences
> and state of their consciousness, the many and manifold things.

I *think* you're claiming that everyone here knows nearly everything
about C and C++, but using far too many words.  If so, that's
manifestly untrue.  Many people come to these newsgroups to ask
about things they don't know.

> So, then to talking about C and C++, first of all is that here
> it's pretty much: "C/C++".
[...]
> We all know all this, it's no big deal.

Absolutely not.  C and C++ are two very different languages.  C++
is nearly a superset of C, and most valid C programs either are
already valid C++ or can be made into valid C++  via some fairly
straightforward transformations (such as avoiding C++ keywords),
but the result is unlikely to be good C++.

[...]

> Here then for example, what I'm trying to figure out is basically
> how to make for C what's in C++ without being in C++ that's yet
> readily adaptable for calling and being called from and into C++
> from C.

Why?  C++ already exists; why not use it if it provides features that
you want?

[...]

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1617
Author: Chris M. Thomasson
Date: Wed, 18 Nov 2026 07:11
77 lines
5027 bytes
On 11/10/2026 1:21 PM, Lynn McGuire wrote:
> On 11/10/2026 3:12 PM, Chris M. Thomasson wrote:
>> On 11/10/2026 12:48 PM, Lynn McGuire wrote:
>>> On 11/10/2026 12:25 AM, Chris M. Thomasson wrote:
>>>> On 11/9/2026 8:39 PM, Lynn McGuire wrote:
>>>>> On 11/9/2026 6:54 PM, Keith Thompson wrote:
>>>>>> Lawrence D’Oliveiro <ldo@nz.invalid> writes:
>>>>>>> On Mon, 9 Nov 2026 06:00:40 -0500, James Kuyper wrote:
>>>>>>>> I tend not to use unnecessary parentheses, and I know the grammar
>>>>>>>> well enough to correctly identify them - but many people don't know
>>>>>>>> the grammar that well, which might include the next person to
>>>>>>>> maintain my code.
>>>>>>>
>>>>>>> Even if they haven’t committed the precedence table to memory, 
>>>>>>> surely
>>>>>>> they have the ability to look things up online
>>>>>>> <https://en.cppreference.com/c/language/operator_precedence>.
>>>>>>>
>>>>>>> If someone has regular trouble with certain language features, why
>>>>>>> aren’t pages that clarify those very issues not already in their
>>>>>>> browser bookmarks?
>>>>>>
>>>>>> If I haven't memorized all the precedence levels, I greatly prefer
>>>>>> an expression I can read at a glance to one that requires me to
>>>>>> consult some document before I can be sure what it means, just so
>>>>>> I can continue to the next line of code.
>>>>>>
>>>>>> Just one example: I couldn't tell you whether `^` or `|` binds more
>>>>>> tightly without looking it up.  If you can, that's great.
>>>>>>
>>>>>> Preferences for *how many* strictly semantically unnecessary
>>>>>> parentheses are appropriate vary greatly, but few C programmers
>>>>>> would insist on none.
>>>>>
>>>>> I ship my software written in four different software languages.  
>>>>> C+ +, Fortran, Visual Basic, and C#.  Remembering the nuances of 
>>>>> each is tricky.  I find it best to be safe.
>>>>>
>>>>> I have shipped software in about a dozen software languages in my 
>>>>> 51 year career.  C++, Fortran IV (66), Fortran 77, Visual Basic, 
>>>>
>>>> VB 6? Do you use access as well?
>>>>
>>>>> C#, Turbo Pascal, Basic, Turbo C, Unix C, IBM 370 Assembler, Intel 
>>>>> x86 Assembler, AWK.  I think that I am leaving out a couple that I 
>>>>> cannot remember at the moment.
>>>>>
>>>>> Lynn
>>>
>>> Nope.  It is just a sample app with source code to show how to 
>>> connect to my DLLs using VB. 
>>
>> That's fine. Fwiw, I wrote a full blown specialized whole home/pool 
>> inspection system using VB 6, Access and Word 6 for my Dad way back in 
>> the day. What service pack are you using? Those were fun... ahh, back 
>> in the day... ;^o
>>
>>
>>> I have several samples apps including an Excel spreadsheet.  I have 
>>> never used Access.
>>
>> Actually, Access worked pretty damn good for my needs. Then, iirc, it 
>> got superseded by SQL server.
>>
>>
>>> All of my calculation software is currently Win32 DLLs so my 
>>> customers can easily use them for custom calculations.
>>
>> Well, that should work fine. Once they know the API, anybody should be 
>> able to use them. Iirc, it was a little strange to map DLL's created 
>> in C to the VB 6 data types. But, can be done for sure.
> 
> VB6 SP5 IIRC.

Nice. I think I still have a CD with a SP3. Going from VB to Win32 and 
back can be done, but its always felt odd to me.
Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1618
Author: Chris M. Thomasson
Date: Wed, 18 Nov 2026 07:13
78 lines
5021 bytes
On 11/10/2026 1:21 PM, Lynn McGuire wrote:
> On 11/10/2026 3:12 PM, Chris M. Thomasson wrote:
>> On 11/10/2026 12:48 PM, Lynn McGuire wrote:
>>> On 11/10/2026 12:25 AM, Chris M. Thomasson wrote:
>>>> On 11/9/2026 8:39 PM, Lynn McGuire wrote:
>>>>> On 11/9/2026 6:54 PM, Keith Thompson wrote:
>>>>>> Lawrence D’Oliveiro <ldo@nz.invalid> writes:
>>>>>>> On Mon, 9 Nov 2026 06:00:40 -0500, James Kuyper wrote:
>>>>>>>> I tend not to use unnecessary parentheses, and I know the grammar
>>>>>>>> well enough to correctly identify them - but many people don't know
>>>>>>>> the grammar that well, which might include the next person to
>>>>>>>> maintain my code.
>>>>>>>
>>>>>>> Even if they haven’t committed the precedence table to memory, 
>>>>>>> surely
>>>>>>> they have the ability to look things up online
>>>>>>> <https://en.cppreference.com/c/language/operator_precedence>.
>>>>>>>
>>>>>>> If someone has regular trouble with certain language features, why
>>>>>>> aren’t pages that clarify those very issues not already in their
>>>>>>> browser bookmarks?
>>>>>>
>>>>>> If I haven't memorized all the precedence levels, I greatly prefer
>>>>>> an expression I can read at a glance to one that requires me to
>>>>>> consult some document before I can be sure what it means, just so
>>>>>> I can continue to the next line of code.
>>>>>>
>>>>>> Just one example: I couldn't tell you whether `^` or `|` binds more
>>>>>> tightly without looking it up.  If you can, that's great.
>>>>>>
>>>>>> Preferences for *how many* strictly semantically unnecessary
>>>>>> parentheses are appropriate vary greatly, but few C programmers
>>>>>> would insist on none.
>>>>>
>>>>> I ship my software written in four different software languages.  
>>>>> C+ +, Fortran, Visual Basic, and C#.  Remembering the nuances of 
>>>>> each is tricky.  I find it best to be safe.
>>>>>
>>>>> I have shipped software in about a dozen software languages in my 
>>>>> 51 year career.  C++, Fortran IV (66), Fortran 77, Visual Basic, 
>>>>
>>>> VB 6? Do you use access as well?
>>>>
>>>>> C#, Turbo Pascal, Basic, Turbo C, Unix C, IBM 370 Assembler, Intel 
>>>>> x86 Assembler, AWK.  I think that I am leaving out a couple that I 
>>>>> cannot remember at the moment.
>>>>>
>>>>> Lynn
>>>
>>> Nope.  It is just a sample app with source code to show how to 
>>> connect to my DLLs using VB. 
>>
>> That's fine. Fwiw, I wrote a full blown specialized whole home/pool 
>> inspection system using VB 6, Access and Word 6 for my Dad way back in 
>> the day. What service pack are you using? Those were fun... ahh, back 
>> in the day... ;^o
>>
>>
>>> I have several samples apps including an Excel spreadsheet.  I have 
>>> never used Access.
>>
>> Actually, Access worked pretty damn good for my needs. Then, iirc, it 
>> got superseded by SQL server.
>>
>>
>>> All of my calculation software is currently Win32 DLLs so my 
>>> customers can easily use them for custom calculations.
>>
>> Well, that should work fine. Once they know the API, anybody should be 
>> able to use them. Iirc, it was a little strange to map DLL's created 
>> in C to the VB 6 data types. But, can be done for sure.
> 
> VB6 SP5 IIRC.

Iirc, there was some cd's for the local MSDN, or something. God its been 
a while. Iirc, they had some examples.

Re: does an expression in a logical statement need parenthesis for proper evaluation?
#1620
Author: David Brown
Date: Wed, 18 Nov 2026 07:43
199 lines
11087 bytes
On 18/11/2026 01:26, Ross Finlayson wrote:
> On 11/17/2026 01:53 PM, Keith Thompson wrote:
>> Ross Finlayson <ross.a.finlayson@gmail.com> writes:
>>> On 11/16/2026 03:17 PM, Keith Thompson wrote:
>>>> Ross Finlayson <ross.a.finlayson@gmail.com> writes:
>>>> [...]
>>>>> That said, I'll yet aver that my command of the concepts is
>>>>> very strong, and it's toward, for example, "Grice", "Grice's maxims",
>>>>> of communication, or for example typical accounts of, "effective
>>>>> communication", vis-a-vis ethos and pathos and kairos here the 
>>>>> _logos_,
>>>>> and not mambly-pambly sorts manager-speak, nor "control freaks",
>>>>> I'll aver that the more you know the better it goes.
>>>> [...]
>>>>
>>>> This is exactly the kind of writing style that makes it difficult,
>>>> and frankly not worth the effort, to understand what you're saying.
>>>>
>>>> Perhaps you assume that people know about "Grice's maxims".  I *think*
>>>> I had heard of them.  Looking them up just now, I find that they're a
>>>> set of principles for clear and cooperative communication.  You seem
>>>> to prioritize deliberate obscurity over clarity and informativeness.
>>>>
>>>> Consider the fact that multiple people here have criticized your
>>>> writing style, and I'm fairly sure nobody has said anything good
>>>> about it.
>>>>
>>>> And while I can't be sure, I don't believe you've written anything
>>>> interesting enough to be worth the effort of decoding it.
>>>>
>>>> Don't feel obligated to reply to this.
>>>
>>> I blame Wittgenstein, and the Whorfian. So, Wittgenstein was a
>>> "philosopher", and Whorf, a "linguist". And what they say is
>>> that nobody understands anybody. I disagree with this.
>>> (And others do, too.)
>> [82 lines deleted]
>>
>> Ross, do you understand that the vast majority of other readers in
>> this newsgroup *don't know what you're talking about*?
>>
>> Perhaps you're being very clever in your writing, but the net effect
>> is that you're posting large volumes of what most or all of us
>> see as word salad.  This isn't about philosophy or linguistics.
>> It's about *you* using an impenetrable writing style and wasting
>> everyone's time.  That's your fault, not anyone else's.
>>
>> And your long discourses about linguistics are off-topic in newsgroups
>> where we discuss the C and C++ programming languages.
>>
>> Try reading some other articles that have been posted here, and
>> that have been part of meaninful discussions.  Consider trying to
>> emulate the style of those articles -- *if* you want to talk about
>> C and C++.  If you want to talk about something other than C and C++,
>> please don't do it here.
>>
> 
> 
> Thanks for writing, Keith. To be sure, if there was "offense", or,
> you know, "hurt", none was meant, in this case. It's not considered
> an affront to be talkative on open forae, "in the spirit of the
> charter", say.
> 

We are not taking offence at anything.  We are asking that you cut out 
the absurd pseudo-intellectual writing.  You seem to love name dropping, 
so here is one for you - the Dunning-Kruger effect.  You believe you 
have an advanced writing style, but you do not.  A classic sign is the 
use of nonsense "Latin plurals" like "forae".  The word "forum" is 
English, and its plural in English is "forums".  That the etymology is 
Latin is irrelevant.  People that aim to write clearly and simply 
without being pretentious write "forums" without thinking about it. 
People who study linguistics or more advanced writing understand that 
"forum" comes from the Latin but in English the plural is "forums". 
People that want to show off that they believe they are more "educated" 
or "sophisticated" than others, write "forae" (or less inaccurately, 
"fora") and feel smug about it.

You have a serious communications problem.  It is something you need to 
accept and understand - then you can improve on it.  Don't listen to 
what sycophantic AI systems tell you about your writing - listen to what 
real people tell you.

> Since we are neither pseudonymizing trolls nor sockpuppet-bots,
> either of which lies in transgression of the charter, then in
> speaking to "comp.lang.c" and "comp.lang.c++", it's well expected
> that first of all most-everybody knows most-everything about these
> languages, if not necessarily of similar or even equivalent experience,
> then when we talk about, for example, "C11" and "C++11", then it's
> beyond the surface and as well from many perspectival accounts.
> 
> It's not for example necessarily "the standards working groups",
> vis-a-vis something like "comp.lang.c++.moderated", which last
> it says was looking for a moderator, that we self-regular and
> moderate ourselves, including with such gentle remonstrances
> as you and others provide, helping express sentiment and reaction,
> as part of "letters" and here "belles lettres" and so on.
> 
> So, first of all, we all know pretty much anything about C and C++,
> or it's readily recounted, and to see it's "known" is as we can
> read it as we see it, relate it to the standard and formal accounts,
> it all makes sense, these are each languages with their syntax and
> semantics about the guarantees and behavior, it's the way of the
> things. Then, each has their _own_ account, sums of their influences
> and state of their consciousness, the many and manifold things.
> 
> 
> So, then to talking about C and C++, first of all is that here
> it's pretty much: "C/C++". There've long been def'd or ndef'd
> the _cplusplus macro and "extern "C"", it's C/C++ with regards
> to both their languages, together "C/C++", then for example with
> "C11" for the .h/.c files and "C++11" for the .h/.hpp/.cpp/.cxx/...
> C++ files, the sources, according to the compilers, or in all
> respect to "GCC", vis-a-vis "g++", "gcc", and C and C++.
> 
> 
> We all know all this, it's no big deal.

Why not simply write :

"""
Everyone in comp.lang.c and comp.lang.c++ already knows almost 
everything about the C and C++ languages.  And really, there is only one 
language - C/C++.
"""

It would be a much more succinct way to say exactly the same thing. 
Both claims are completely wrong, but at least if people can see what 
you are writing, we can start talking about /why/ you are wrong, and 
give you a better understanding.

> 
> 
> Then there's that requirement or preference (or inheritance,
> often enough) has that some code is C and some code is C++
> without C (though, often enough it "is" also "legal in C"),
> then various accounts of standards have some people are sticklers
> (like for "C99/C++03", some with C++ 08 or 11 or 20 or 23, or what
> it is) and some are slackers ("it compiles"), and others, euh,
> "stagers", always with the latest bleeding-edge features of the
> language since it's not relevant "stability" or that various
> accounts of "simplicity" talk past each other. It varies.
> 
> 
> Here then for example, what I'm trying to figure out is basically
> how to make for C what's in C++ without being in C++ that's yet
> readily adaptable for calling and being called from and into C++
> from C. Like, for example, "sequence" or "iter", and "lister"
> and the like, then for something like "C11 _Generic", making accounts
> of generics the types in C vis-a-vis the polymorphic class model
> in C++, about "sized" or accounts like "characteristics" of access
> of arrays, pointer-offsets, lists, otherwise the usual things,
> "holders", "getters and setters", then about "libraries" and
> "components", after things like "success_t, error_t, and return_t,
> for context_t", definitions of the patterns, that would be generally
> suitable for writing libraries in C and having them callable and
> calling to and from C++, these are the kinds of things I'm liking
> to figure out.
> 
> 
> Like for example about how to pass an allocator into C, or making
> access of ctx_new/ctx_del or ctx_init/ctx_fini, those being about
> storage or lifetime and ownership and responsibility, then for
> things like "emit_log" and "emit_metric" and "emit_dump", these
> are the kinds of things that later always live in any sort of
> application framework, for making good-style.
> 

Why not just write :

"""
How do I write C++ code in C?
"""

The answer then would be, you don't.  Write C++ code in C++.  Write C 
code in C.

> 
> 
> Parentheses are generally useful in expressions since if they're
> nested so deep as to become cumbersome, that's too much on one line.
> People are yet expected to be familiar and immediately recognize
> accounts like "star-p and post-increment", "the C idiom" (for iterators
> and matching iterators), then about: getting _above_ that stuff,
> yet, not too high.
> 

Saying nothing but referring to the original post in a thread does not 
make the post topical.

> 
> 
> Warm, i.e., warm regards.
> 
> 
> 
> 
> 
[meta] O tempora, o mores! (was Re: does an expression in a logical statement need parenthesis for proper evaluation?)
#1621
Author: Janis Papanagnou
Date: Wed, 18 Nov 2026 08:44
54 lines
4458 bytes
On 2026-11-18 08:43, David Brown wrote:
> On 18/11/2026 01:26, Ross Finlayson wrote:
>> [...]
> 
> We are not taking offence at anything.  We are asking that you cut out 
> the absurd pseudo-intellectual writing.  You seem to love name dropping, 
> so here is one for you - the Dunning-Kruger effect.  You believe you 
> have an advanced writing style, but you do not.  A classic sign is the 
> use of nonsense "Latin plurals" like "forae".  The word "forum" is 
> English, and its plural in English is "forums".  That the etymology is 
> Latin is irrelevant.  People that aim to write clearly and simply 
> without being pretentious write "forums" without thinking about it. 
> People who study linguistics or more advanced writing understand that 
> "forum" comes from the Latin but in English the plural is "forums". 
> People that want to show off that they believe they are more "educated" 
> or "sophisticated" than others, write "forae" (or less inaccurately, 
> "fora") and feel smug about it.

Erm..., you mean "forae" is "inaccurate"; not plain wrong!?

The "fora" might be okay in nominative form but depending on
context shouldn't one also expect - exempli gratia! :-) -
"foro" and "foris" (the singular/plural ablative forms).

IOW; why opening the can of worms?! (The dispute got silly.)


WRT the massive comments on Ross' way to express himself...

Teaching adult people how they should talk I consider rude
and presumptuous. He's already been told by multiple posters
that his way of writing is by some considered confusing, or
unnecessary voluminous, or demanding, whatever - now he and
we all, each of use, can decide whether we change, continue,
or stop our communication engagement (here, or in similar
threads).

I'd like to emphasize - and thereby deviate from some other
opinion implied in this thread - that communication is not a
one-way; two parties are involved. (See also Claude Shannon.)

I find his writing more demanding than the usual posts, and
the reference to Wittgenstein might explain something (though
before he mentioned that I was rather thinking more of Kant).
Anyway. The Usenet-Communication Market and time will fix all
discrepancies.

Only, please stop teaching adults! And please omit all those
generalizing statements like "People {do/are} {this/that}".

Janis

> [...]
Page 2 of 4 • 162 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads