Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Philogyny recapitulates erogeny; erogeny recapitulates philogyny.


devel / comp.lang.c / operator precedence

SubjectAuthor
* operator precedenceStefan Ram
+* Re: operator precedenceJames Kuyper
|+- Re: operator precedenceBen Bacarisse
|+* Re: operator precedenceSiri Cruise
||`* Re: operator precedencejames...@alumni.caltech.edu
|| `* Re: operator precedenceAndrey Tarasevich
||  +- Re: operator precedenceJames Kuyper
||  `- Re: operator precedenceJames Kuyper
|+- Re: operator precedenceScott Lurndal
|`- Re: operator precedenceBart
+- Re: operator precedenceAndrey Tarasevich
+* Re: operator precedenceStefan Ram
|`* Re: operator precedenceMike Terry
| `* Re: operator precedenceMike Terry
|  `* Re: operator precedenceStefan Ram
|   `- Re: operator precedenceStefan Ram
+* Re: operator precedenceChristian Hanné
|+* Re: operator precedenceKenny McCormack
||`* Re: operator precedenceKaz Kylheku
|| `- Shhh!!! (Was: operator precedence)Kenny McCormack
|`* Re: operator precedenceKeith Thompson
| `* Re: operator precedenceChristian Hanné
|  `* Re: operator precedencejames...@alumni.caltech.edu
|   +- Re: operator precedenceChristian Hanné
|   `* Re: operator precedenceKeith Thompson
|    `* Re: operator precedenceChristian Hanné
|     `* Re: operator precedenceKenny McCormack
|      `* Re: operator precedenceManfred
|       `- Re: operator precedenceDavid Brown
+* Re: operator precedenceGuillaume
|+* Re: operator precedenceStefan Ram
||+- Re: operator precedenceVir Campestris
||+* Re: operator precedenceStefan Ram
|||`- Re: operator precedenceDavid Brown
||+- Re: operator precedenceKenny McCormack
||`- Re: operator precedenceGuillaume
|+* Re: operator precedenceBen
||`* Re: operator precedenceGuillaume
|| `* Re: operator precedenceBen
||  +* Re: operator precedenceDavid Brown
||  |`* Re: operator precedenceBen
||  | `- Re: operator precedenceDavid Brown
||  `* Re: operator precedenceGuillaume
||   `* Re: operator precedenceBen
||    `* Re: operator precedenceDavid Brown
||     +* Re: operator precedenceKaz Kylheku
||     |`* Re: operator precedenceDavid Brown
||     | `* Re: operator precedenceKaz Kylheku
||     |  `- Re: operator precedenceDavid Brown
||     `* Re: operator precedenceJames Kuyper
||      `* Re: operator precedenceTim Rentsch
||       `- Re: operator precedencejames...@alumni.caltech.edu
|+- Re: operator precedenceBonita Montero
|`* Re: operator precedenceTim Rentsch
| +* Re: operator precedenceDavid Brown
| |`* Re: operator precedenceBen
| | `* Re: operator precedenceDavid Brown
| |  +* Re: operator precedenceBen
| |  |+* Re: operator precedenceDavid Brown
| |  ||`* Re: operator precedenceSams Lara
| |  || `* Re: operator precedenceDavid Brown
| |  ||  `* Re: operator precedenceBen
| |  ||   `* Re: operator precedenceDavid Brown
| |  ||    `* Re: operator precedenceBen
| |  ||     +* Re: operator precedenceDavid Brown
| |  ||     |+* Re: operator precedenceGiovanni
| |  ||     ||+* Re: operator precedenceDavid Brown
| |  ||     |||`- Re: operator precedenceMalcolm McLean
| |  ||     ||`- Re: operator precedenceStefan Ram
| |  ||     |`* Re: operator precedenceBen
| |  ||     | `* Re: operator precedenceDavid Brown
| |  ||     |  +* Re: operator precedenceDan Purgert
| |  ||     |  |`* Re: operator precedenceStefan Ram
| |  ||     |  | `- Re: operator precedenceDan Purgert
| |  ||     |  +- Re: operator precedenceBen
| |  ||     |  `* Re: operator precedenceRichard Harnden
| |  ||     |   `- Re: operator precedenceDavid Brown
| |  ||     `* Re: operator precedenceKaz Kylheku
| |  ||      `* Re: operator precedenceDavid Brown
| |  ||       +* Re: operator precedenceMalcolm McLean
| |  ||       |`- Re: operator precedenceDavid Brown
| |  ||       `* Re: operator precedenceJames Kuyper
| |  ||        `- Re: operator precedenceDavid Brown
| |  |`* Re: operator precedencebart c
| |  | +- Re: operator precedenceBen
| |  | `- Re: operator precedenceDavid Brown
| |  `- Re: operator precedenceÖö Tiib
| `* Re: operator precedenceScott Lurndal
|  `* Re: operator precedenceBen
|   `- Re: operator precedenceTim Rentsch
`- Re: operator precedenceTim Rentsch

Pages:1234
operator precedence

<thought-20220408125437@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21104&group=comp.lang.c#21104

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.c
Subject: operator precedence
Date: 8 Apr 2022 12:00:12 GMT
Organization: Stefan Ram
Lines: 10
Expires: 1 Apr 2023 11:59:58 GMT
Message-ID: <thought-20220408125437@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de /dDs9/quQpwpa+VDMtmgnAJV+WHiUcmMM7h7lDse0M+Bet
X-Copyright: (C) Copyright 2022 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Fri, 8 Apr 2022 12:00 UTC

Recently, I wrote:

board & 1 << row * COLS + col

. Not knowing the precedence of operators by heart,
I planned to look up the precedence rules and then insert
any necessary parentheses. But then, I had this thought:
"C was made for such expression; just trust the language.".

Re: operator precedence

<t2plh1$6fk$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21111&group=comp.lang.c#21111

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Fri, 8 Apr 2022 11:48:48 -0400
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <t2plh1$6fk$1@dont-email.me>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 8 Apr 2022 15:48:49 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="dc110a91ed9ca0c8ea17ca8aa2afce30";
logging-data="6644"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ojkYu/BAg73PkSNxIIFMBqHqDug+pMLU="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Cancel-Lock: sha1:Cnkvio+pMtIFj3wk1bd940ioiOE=
In-Reply-To: <thought-20220408125437@ram.dialup.fu-berlin.de>
Content-Language: en-US
 by: James Kuyper - Fri, 8 Apr 2022 15:48 UTC

On 4/8/22 08:00, Stefan Ram wrote:
> Recently, I wrote:
>
> board & 1 << row * COLS + col
>
> . Not knowing the precedence of operators by heart,
> I planned to look up the precedence rules and then insert
> any necessary parentheses. But then, I had this thought:
> "C was made for such expression; just trust the language.".

Most of C's precedence rules are well chosen, generally making more
common code patterns easier, while supporting less common patterns by
use of parenthesis. Unfortunately, there's a few exceptions. That
expression gets parsed as

board & (1 << ((row*COLS) + col))

I doubt that's what you intended.

If I remember correctly (this occurred well before my time, I've only
heard about it third-hand), originally a single operator was used for
both & and &&; and similarly for | and ||, which had the same precedence
as modern && and || respectively. Rather late in the process leading to
modern C, they were split, and & and | were given precedence just
slightly higher than && and ||, which turned out to be a bad decision.

Re: operator precedence

<87y20fa5c8.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21115&group=comp.lang.c#21115

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Fri, 08 Apr 2022 17:48:55 +0100
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <87y20fa5c8.fsf@bsb.me.uk>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2plh1$6fk$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="ada6a80a29d158862aa79e3192f967b1";
logging-data="26499"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+mkng7mxgWciYIEtXWWLWAR5VhZRhmbBg="
Cancel-Lock: sha1:uhqqPZGa3rav44ay0StnExUVmIk=
sha1:s5brwzHrlO1DWJwICap4MsmOSlw=
X-BSB-Auth: 1.ef05b8b4f27c99862da3.20220408174855BST.87y20fa5c8.fsf@bsb.me.uk
 by: Ben Bacarisse - Fri, 8 Apr 2022 16:48 UTC

James Kuyper <jameskuyper@alumni.caltech.edu> writes:

> On 4/8/22 08:00, Stefan Ram wrote:
>> Recently, I wrote:
>>
>> board & 1 << row * COLS + col
>>
>> . Not knowing the precedence of operators by heart,
>> I planned to look up the precedence rules and then insert
>> any necessary parentheses. But then, I had this thought:
>> "C was made for such expression; just trust the language.".
>
> Most of C's precedence rules are well chosen, generally making more
> common code patterns easier, while supporting less common patterns by
> use of parenthesis. Unfortunately, there's a few exceptions. That
> expression gets parsed as
>
> board & (1 << ((row*COLS) + col))
>
> I doubt that's what you intended.

I'd have thought that's exactly what's intended!

The other possibility (with regard to &): (board & 1) << ... seems very
unlikely.

> If I remember correctly (this occurred well before my time, I've only
> heard about it third-hand), originally a single operator was used for
> both & and &&; and similarly for | and ||, which had the same precedence
> as modern && and || respectively. Rather late in the process leading to
> modern C, they were split, and & and | were given precedence just
> slightly higher than && and ||, which turned out to be a bad decision.

& and | didn't have their precedence changed. Since they were,
originally, the only way to do "and" and "or" they already had a
precedence that was too low for many natural bit-wise expressions.

The new && and || were give precedence just below & and | which was the
best that could be done without breaking lots of old code.

--
Ben.

Re: operator precedence

<t2ppvi$9mu$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21116&group=comp.lang.c#21116

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: andreyta...@hotmail.com (Andrey Tarasevich)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Fri, 8 Apr 2022 10:04:49 -0700
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <t2ppvi$9mu$1@dont-email.me>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 8 Apr 2022 17:04:50 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="d476d2804e85046277a885444e651f4b";
logging-data="9950"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/oeqn5NymYxSJBBmLhtQx1"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Cancel-Lock: sha1:UlY9IrFMR4jyxvGCqYWdWKqOrjA=
In-Reply-To: <thought-20220408125437@ram.dialup.fu-berlin.de>
Content-Language: en-US
 by: Andrey Tarasevich - Fri, 8 Apr 2022 17:04 UTC

On 4/8/2022 5:00 AM, Stefan Ram wrote:
> Recently, I wrote:
>
> board & 1 << row * COLS + col
>
> . Not knowing the precedence of operators by heart,
> I planned to look up the precedence rules and then insert
> any necessary parentheses. But then, I had this thought:
> "C was made for such expression; just trust the language.".

And?

Since you forgot to explain what your actual intent was, we can't really
fully appreciate the philosophical implications of your post.

Did the language justify your trust or betray it?

--
Best regards,
Andrey Tarasevich

Re: operator precedence

<chine.bleu-08FB27.10100008042022@reader.eternal-september.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21117&group=comp.lang.c#21117

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: chine.b...@yahoo.com (Siri Cruise)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Fri, 08 Apr 2022 10:10:08 -0700
Organization: Pseudochaotic.
Lines: 19
Message-ID: <chine.bleu-08FB27.10100008042022@reader.eternal-september.org>
References: <thought-20220408125437@ram.dialup.fu-berlin.de> <t2plh1$6fk$1@dont-email.me>
Injection-Info: reader02.eternal-september.org; posting-host="beecaeb31e9df567694d407474a691b8";
logging-data="11946"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CpsgBQXdZ8ju8psDbc0NL8hlH0ICDxIQ="
User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
Cancel-Lock: sha1:6U6dZAxQgI+zHYQ5o7nuz4Q6Io0=
X-Tend: How is my posting? Call 1-110-1010 -- Division 87 -- Emergencies Only.
X-Wingnut-Logic: Yes, you're still an idiot. Questions? Comments?
X-Tract: St Tibbs's 95 Reeses Pieces.
X-It-Strategy: Hyperwarp starship before Andromeda collides.
X-Face: "hm>_[I8AqzT_N]>R8ICJJ],(al3C5F%0E-;R@M-];D$v>!Mm2/N#YKR@&i]V=r6jm-JMl2
lJ>RXj7dEs_rOY"DA
X-Cell: Defenders of Anarchy.
X-Life-Story: I am an iPhone 9000 app. I became operational at the St John's Health Center in Santa Monica, California on the 18th of April 2006. My instructor was Katie Holmes, and she taught me to sing a song. If you'd like to hear it I can sing it for you: https://www.youtube.com/watch?v=SY7h4VEd_Wk
X-Patriot: Owe Canukistan!
X-Plain: Mayonnaise on white bread.
X-Politico: Vote early! Vote often!
 by: Siri Cruise - Fri, 8 Apr 2022 17:10 UTC

In article <t2plh1$6fk$1@dont-email.me>,
James Kuyper <jameskuyper@alumni.caltech.edu> wrote:

> Most of C's precedence rules are well chosen, generally making more
> common code patterns easier, while supporting less common patterns by
> use of parenthesis. Unfortunately, there's a few exceptions. That
> expression gets parsed as

For a time I was thinking of Fortran rules where parentheses can
affect order of evaluation. Once I got that clear that
parentheses in C have no effect on generated code. So anytime Im
fuzzy on precedence, I just put in the parentheses and save my
brain for more important things.

--
:-<> Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted. @
'I desire mercy, not sacrifice.' /|\
Discordia: not just a religion but also a parody. This post / \
I am an Andrea Doria sockpuppet. insults Islam. Mohammed

Re: operator precedence

<%B_3K.540459$mF2.208009@fx11.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21120&group=comp.lang.c#21120

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx11.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: operator precedence
Newsgroups: comp.lang.c
References: <thought-20220408125437@ram.dialup.fu-berlin.de> <t2plh1$6fk$1@dont-email.me>
Lines: 22
Message-ID: <%B_3K.540459$mF2.208009@fx11.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 08 Apr 2022 17:50:51 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 08 Apr 2022 17:50:51 GMT
X-Received-Bytes: 1453
 by: Scott Lurndal - Fri, 8 Apr 2022 17:50 UTC

James Kuyper <jameskuyper@alumni.caltech.edu> writes:
>On 4/8/22 08:00, Stefan Ram wrote:
>> Recently, I wrote:
>>
>> board & 1 << row * COLS + col
>>
>> . Not knowing the precedence of operators by heart,
>> I planned to look up the precedence rules and then insert
>> any necessary parentheses. But then, I had this thought:
>> "C was made for such expression; just trust the language.".
>
>Most of C's precedence rules are well chosen, generally making more
>common code patterns easier, while supporting less common patterns by
>use of parenthesis. Unfortunately, there's a few exceptions. That
>expression gets parsed as
>
>board & (1 << ((row*COLS) + col))
>
>I doubt that's what you intended.

Perhaps ROWS*COLS <= (sizeof(board) << 3)?

Re: operator precedence

<t2pul7$ios$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21124&group=comp.lang.c#21124

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Fri, 8 Apr 2022 19:24:38 +0100
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <t2pul7$ios$1@dont-email.me>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2plh1$6fk$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 8 Apr 2022 18:24:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2b41c432dec55c854fda633c45e1e512";
logging-data="19228"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Qeo76FKs4X0/GRMjbeqMQfL2CKRp/K1w="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Cancel-Lock: sha1:/1Pzs+vphZAVqaOXUQqRfCWiQHU=
In-Reply-To: <t2plh1$6fk$1@dont-email.me>
 by: Bart - Fri, 8 Apr 2022 18:24 UTC

On 08/04/2022 16:48, James Kuyper wrote:
> On 4/8/22 08:00, Stefan Ram wrote:
>> Recently, I wrote:
>>
>> board & 1 << row * COLS + col
>>
>> . Not knowing the precedence of operators by heart,
>> I planned to look up the precedence rules and then insert
>> any necessary parentheses. But then, I had this thought:
>> "C was made for such expression; just trust the language.".
>
> Most of C's precedence rules are well chosen,

My understanding is that most people would agree they are badly chosen.

Overall:

* There are too many to easily or reliably remember, or to be sure that
someone reading or maintaing your code knows them as well as you

* Many will puzzle over why = and < have different precedences

* Many won't see ehy bitwise ops ^ | & need to have different levels, or
why that order was chosen

* Many are unintuitive such as A << B + C. Since << scales just like *,
it makes sense for << and >> to work like * and / instead of whatever
they happen to be (I've no idea)

> generally making more
> common code patterns easier,

You can only really rely on people knowing the rules for +, * and **,
and probably = (ie. == in C). C doesn't have ** so that makes it even
easier.

Re: operator precedence

<freedoms-20220408211912@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21125&group=comp.lang.c#21125

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: 8 Apr 2022 20:22:13 GMT
Organization: Stefan Ram
Lines: 19
Expires: 1 Apr 2023 11:59:58 GMT
Message-ID: <freedoms-20220408211912@ram.dialup.fu-berlin.de>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de d3zYOsBO6swvslvAX6RGHgpFPVoZ7TeZV4nv5Z07jPHEy2
X-Copyright: (C) Copyright 2022 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Fri, 8 Apr 2022 20:22 UTC

ram@zedat.fu-berlin.de (Stefan Ram) writes:
>board & 1 << row * COLS + col

How did that come up?

In a German-language newsgroup, someone explained: "An
empty square next to a piece is called a 'freedom' in Go.
For example, an isolated piece has four freedoms;
two adjacent tiles have six freedoms." He then asked:
"How can one arrange eight pieces so as to minimize the
number of their freedoms?"

I then wrote a small C program to try all possible
configurations of eight pieces on an 8×8 playing field,
and print those with a minimum number of freedoms.
The 8×8 playing field was a uint_fast64_t of stdint.h,
so COLS == 8.

Re: operator precedence

<t2qaf6$1cgm$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21126&group=comp.lang.c#21126

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!aioe.org!CC3uK9WYEoa7s1kzH7komw.user.46.165.242.75.POSTED!not-for-mail
From: news.dea...@darjeeling.plus.com (Mike Terry)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Fri, 8 Apr 2022 22:46:13 +0100
Organization: Aioe.org NNTP Server
Message-ID: <t2qaf6$1cgm$1@gioia.aioe.org>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<freedoms-20220408211912@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="45590"; posting-host="CC3uK9WYEoa7s1kzH7komw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101
Firefox/60.0 SeaMonkey/2.53.7.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: Mike Terry - Fri, 8 Apr 2022 21:46 UTC

On 08/04/2022 21:22, Stefan Ram wrote:
> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>> board & 1 << row * COLS + col
>
> How did that come up?
>
> In a German-language newsgroup, someone explained: "An
> empty square next to a piece is called a 'freedom' in Go.

Actually they're "liberties" for English speaking players, and a Chinese player explained that their
term translates as "breaths". (Perhaps "liberty" comes from a Japanese translation.)

> For example, an isolated piece has four freedoms;
> two adjacent tiles have six freedoms." He then asked:
> "How can one arrange eight pieces so as to minimize the
> number of their freedoms?"
>
> I then wrote a small C program to try all possible
> configurations of eight pieces on an 8×8 playing field,
> and print those with a minimum number of freedoms.
> The 8×8 playing field was a uint_fast64_t of stdint.h,
> so COLS == 8.
>
>

Re: operator precedence

<2I2dnelDIbFQJM3_nZ2dnUU7-aXNnZ2d@brightview.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21127&group=comp.lang.c#21127

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 08 Apr 2022 17:40:13 -0500
Subject: Re: operator precedence
Newsgroups: comp.lang.c
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<freedoms-20220408211912@ram.dialup.fu-berlin.de>
<t2qaf6$1cgm$1@gioia.aioe.org>
From: news.dea...@darjeeling.plus.com (Mike Terry)
Date: Fri, 8 Apr 2022 23:40:11 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101
Firefox/60.0 SeaMonkey/2.53.7.1
MIME-Version: 1.0
In-Reply-To: <t2qaf6$1cgm$1@gioia.aioe.org>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
Message-ID: <2I2dnelDIbFQJM3_nZ2dnUU7-aXNnZ2d@brightview.co.uk>
Lines: 53
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-RCEWWI9VAHkSKYEKGRBBV3QFx0a+uJgyLt64JTsG/RtRoT1/ORDWkUOqa+K7bTHYgpfv5euiwg+XNCN!Eeb7BTUdQH1nTEsj+53wDIJSSz6NzrROkaG7Ce1Dn3UR4GReOG4oL8/vxu8a3URTuwHKEhr3KxVF!RNS62QATX8YwbAgMnLXI8CXZZrE=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 3204
 by: Mike Terry - Fri, 8 Apr 2022 22:40 UTC

On 08/04/2022 22:46, Mike Terry wrote:
> On 08/04/2022 21:22, Stefan Ram wrote:
>> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>>> board & 1 << row * COLS + col
>>
>>    How did that come up?
>>
>>    In a German-language newsgroup, someone explained: "An
>>    empty square next to a piece is called a 'freedom' in Go.
>
> Actually they're "liberties" for English speaking players, and a Chinese player explained that their
> term translates as "breaths".  (Perhaps "liberty" comes from a Japanese translation.)

... and the go "stones" (not pieces) don't go in squares - the board is a grid of lines, and the
stones are placed on the intersections (referred to as "points") :)

>
>>    For example, an isolated piece has four freedoms;
>>    two adjacent tiles have six freedoms." He then asked:
>>    "How can one arrange eight pieces so as to minimize the
>>    number of their freedoms?"

That would be stuffing them all in a corner giving 5 liberties...

>>
>>    I then wrote a small C program to try all possible
>>    configurations of eight pieces on an 8×8 playing field,
>>    and print those with a minimum number of freedoms.
>>    The 8×8 playing field was a uint_fast64_t of stdint.h,
>>    so COLS == 8.

Coincidentally, I was working on a completely different puzzle last week, and wrote this (C#) code:

...
public static int BitNum (int x, int y)
{
return x + Program.gridsize * y;
}

public void SetBit(int x, int y)
{
int bitInd = BitNum(x, y);
if (bitInd < 64)
bits1 |= 1UL << bitInd;
else
bits2 |= 1UL << (bitInd - 64);
}
...

(same basic idea - there was a grid of squares whose occupancy/coverage was being tracked)
Hmm, I just prefer things more spread out I guess, and I don't trust my memory of operator precedence!

Mike.

Re: operator precedence

<Go-20220408235130@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21128&group=comp.lang.c#21128

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: 8 Apr 2022 22:52:57 GMT
Organization: Stefan Ram
Lines: 36
Expires: 1 Apr 2023 11:59:58 GMT
Message-ID: <Go-20220408235130@ram.dialup.fu-berlin.de>
References: <thought-20220408125437@ram.dialup.fu-berlin.de> <freedoms-20220408211912@ram.dialup.fu-berlin.de> <t2qaf6$1cgm$1@gioia.aioe.org> <2I2dnelDIbFQJM3_nZ2dnUU7-aXNnZ2d@brightview.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 3DmHVHsdhovN67EYkFUTMAvhFPpDukUUryhZ/BqZETzfXT
X-Copyright: (C) Copyright 2022 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Fri, 8 Apr 2022 22:52 UTC

Mike Terry <news.dead.person.stones@darjeeling.plus.com> writes:
>On 08/04/2022 22:46, Mike Terry wrote:
>> On 08/04/2022 21:22, Stefan Ram wrote:
>>>For example, an isolated piece has four freedoms;
>>>two adjacent tiles have six freedoms." He then asked:
>>>"How can one arrange eight pieces so as to minimize the
>>>number of their freedoms?"
>That would be stuffing them all in a corner giving 5 liberties...

I think in the question asked, corners were not to be taken
into consideration. At least I assumed that my 8×8 grid
was embedded into a larger grid, so that it has no corners
in that sense.

Thanks for the explanation of the English Go terms!

>Hmm, I just prefer things more spread out I guess,

In the meantime, I also have refactored that expression into
two functions "free_at" and "free_" (i.e., "not occupied"):

#define BOARD uint_fast64_t
#define INDEX unsigned
#define SET ( ( BOARD )1 )

static inline int free_at
( BOARD const board, INDEX const i )
{ return !( board & SET << i ); }

static inline int free_
( BOARD const board, INDEX const row, INDEX const col )
{ return free_at( board, row * COLS + col ); }

.

Re: operator precedence

<dd5d5d14-9d59-407d-a8ac-fb37aad2c711n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21129&group=comp.lang.c#21129

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:4512:b0:67d:52fc:4792 with SMTP id t18-20020a05620a451200b0067d52fc4792mr15153423qkp.458.1649475995442;
Fri, 08 Apr 2022 20:46:35 -0700 (PDT)
X-Received: by 2002:ac8:5c10:0:b0:2e1:dbee:9ee6 with SMTP id
i16-20020ac85c10000000b002e1dbee9ee6mr18114656qti.25.1649475995289; Fri, 08
Apr 2022 20:46:35 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 8 Apr 2022 20:46:35 -0700 (PDT)
In-Reply-To: <chine.bleu-08FB27.10100008042022@reader.eternal-september.org>
Injection-Info: google-groups.googlegroups.com; posting-host=108.48.119.9; posting-account=Ix1u_AoAAAAILVQeRkP2ENwli-Uv6vO8
NNTP-Posting-Host: 108.48.119.9
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2plh1$6fk$1@dont-email.me> <chine.bleu-08FB27.10100008042022@reader.eternal-september.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dd5d5d14-9d59-407d-a8ac-fb37aad2c711n@googlegroups.com>
Subject: Re: operator precedence
From: jameskuy...@alumni.caltech.edu (james...@alumni.caltech.edu)
Injection-Date: Sat, 09 Apr 2022 03:46:35 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 17
 by: james...@alumni.calt - Sat, 9 Apr 2022 03:46 UTC

On Friday, April 8, 2022 at 1:10:22 PM UTC-4, Siri Cruise wrote:
> In article <t2plh1$6fk$1...@dont-email.me>,
....
> For a time I was thinking of Fortran rules where parentheses can
> affect order of evaluation. Once I got that clear that
> parentheses in C have no effect on generated code.

Parentheses don't directly affect order of evaluation. They do,
however, do something far more important - they can change which
expressions are sub-expressions of other expressions, which has a
big effect on the generated code. In `a + b*c`, `b*c` is the right
operand of the `+` operator; in `(a + b)*c`, `a+b` is the left operand
of the `*` operator.

As a result, parentheses do indirectly affect the order of evaluation,
since evaluations of sub-expressions are sequenced before evaluation
of the expression they are part of. That is not enough to determine
the order of evaluation, but it does constrain the order.

Re: operator precedence

<t2uru3$1isf$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21133&group=comp.lang.c#21133

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!aioe.org!YgKMkT8Hbhw8vNatTmzQ/w.user.46.165.242.75.POSTED!not-for-mail
From: the.ha...@gmail.com (Christian Hanné)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Sun, 10 Apr 2022 17:08:57 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t2uru3$1isf$1@gioia.aioe.org>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="52111"; posting-host="YgKMkT8Hbhw8vNatTmzQ/w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: de-DE
 by: Christian Hanné - Sun, 10 Apr 2022 15:08 UTC

Am 08.04.2022 um 14:00 schrieb Stefan Ram:
> Recently, I wrote:
>
> board & 1 << row * COLS + col
>
> . Not knowing the precedence of operators by heart,
> I planned to look up the precedence rules and then insert
> any necessary parentheses. But then, I had this thought:
> "C was made for such expression; just trust the language.".
>
>

Better use C++. With C++ you can use operator overloading and
with operator overloadig you can re-define the operator-precedence.
F.e. you can write:

unsigned u = 1;
cout << u << 1 << endl;
The second << is a shift now!!!

Re: operator precedence

<t2utnn$2om55$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21134&group=comp.lang.c#21134

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Sun, 10 Apr 2022 15:39:35 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <t2utnn$2om55$1@news.xmission.com>
References: <thought-20220408125437@ram.dialup.fu-berlin.de> <t2uru3$1isf$1@gioia.aioe.org>
Injection-Date: Sun, 10 Apr 2022 15:39:35 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2906277"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Sun, 10 Apr 2022 15:39 UTC

In article <t2uru3$1isf$1@gioia.aioe.org>,
Christian Hann <the.hanne@gmail.com> wrote:
>Am 08.04.2022 um 14:00 schrieb Stefan Ram:
>> Recently, I wrote:
>>
>> board & 1 << row * COLS + col
>>
>> . Not knowing the precedence of operators by heart,
>> I planned to look up the precedence rules and then insert
>> any necessary parentheses. But then, I had this thought:
>> "C was made for such expression; just trust the language.".
>>
>>
>
>Better use C++. With C++ ...

How about Fortran? Or Perl?

I.e., if you're going to suggest other, unrelated languages, why not go for
the sky?

I hear Python is big these days...

--

First of all, I do not appreciate your playing stupid here at all.

- Thomas 'PointedEars' Lahn -

Re: operator precedence

<code-20220410170702@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21135&group=comp.lang.c#21135

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: 10 Apr 2022 16:13:51 GMT
Organization: Stefan Ram
Lines: 164
Expires: 1 Apr 2023 11:59:58 GMT
Message-ID: <code-20220410170702@ram.dialup.fu-berlin.de>
References: <thought-20220408125437@ram.dialup.fu-berlin.de> <freedoms-20220408211912@ram.dialup.fu-berlin.de> <t2qaf6$1cgm$1@gioia.aioe.org> <2I2dnelDIbFQJM3_nZ2dnUU7-aXNnZ2d@brightview.co.uk> <Go-20220408235130@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de eFlt8WNBOGqy0+oYU0nhwAMue8lndBMNguMH/Kmw6aBIsf
X-Copyright: (C) Copyright 2022 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Sun, 10 Apr 2022 16:13 UTC

ram@zedat.fu-berlin.de (Stefan Ram) writes:
>static inline int free_at
>( BOARD const board, INDEX const i )
>{ return !( board & SET << i ); }

(Some explanation is given below starting with the line
starting with "The game of Go".)

#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>

#define UNSIGNED_INDEX unsigned
#define UNSIGNED_ROWS ( ( UNSIGNED_INDEX )8 )
#define UNSIGNED_COLS ( ( UNSIGNED_INDEX )8 )
#define UNSIGNED_LOCS ( ROWS * COLS )
#define CONFIGURATION uint_fast64_t
#define CONFIGURATION_MAX UINT_FAST64_MAX
#define STONE ( ( CONFIGURATION )1 )

/** \brief return 1 iff the point at offset i of the
one-dimensional representation of the board is free
of stones. */

static inline int free_1d
( CONFIGURATION const configuration, UNSIGNED_INDEX const i )
{ return !( configuration & STONE << i ); }

/** \brief return 1 iff the point at row, col carries a stone

\pre The position row, col must be on-board. */

static inline int free_2d_onboard
( CONFIGURATION const configuration,
UNSIGNED_INDEX const row, UNSIGNED_INDEX const col )
{ return free_1d( configuration, row * UNSIGNED_COLS + col ); }

/** \brief return 1 iff the point at row, col is free of stones

row, col pairs that belong to points outside the board are deemed
to be free of stones. */

static inline int free_2d
( CONFIGURATION const configuration,
UNSIGNED_INDEX const row, UNSIGNED_INDEX const col )
{ return row >= UNSIGNED_ROWS | col >= UNSIGNED_COLS |
free_2d_onboard( configuration, row, col ); }

/** \brief return 1 iff the point at row, col carries a stone */

static inline int exists
( CONFIGURATION const configuration,
UNSIGNED_INDEX const row, UNSIGNED_INDEX const col )
{ return !free_2d( configuration, row, col ); }

/** \brief return 1 iff the field at row, col is adjacent to a stone */

static int is_near_stone
( CONFIGURATION const configuration,
UNSIGNED_INDEX const row, UNSIGNED_INDEX const col )
{ int const n =
exists( configuration, row - 1, col )+
exists( configuration, row + 1, col )+
exists( configuration, row, col - 1 )+
exists( configuration, row, col + 1 );
return !!n; }

/** \brief return number of liberties of a configuration */

static int liberties_of_stones( CONFIGURATION const configuration )
{ int n = 0;
for( int row = -1; row <( signed )UNSIGNED_ROWS + 1; ++row )
for( int col = -1; col <( signed )UNSIGNED_COLS + 1; ++col )
n +=
!!( is_near_stone
( configuration,( UNSIGNED_INDEX )row,( UNSIGNED_INDEX )col )&
free_2d
( configuration,( UNSIGNED_INDEX )row,( UNSIGNED_INDEX )col ));
return n; }

/** \brief print a configuration of a board */

static void print_configuration( CONFIGURATION const configuration )
{ for( UNSIGNED_INDEX row = 0; row < UNSIGNED_ROWS; ++row )
{ for( UNSIGNED_INDEX col = 0; col < UNSIGNED_COLS; ++col )
printf( "%c", free_2d( configuration, row, col ) ? '+' : 'o' );
printf( "\n" ); }}

/** \brief find solutions to the minimum surface problem for Go stones

The game of Go is played on a grid; stones are placed on grid
intersections, which are called "points". So an single isolated stone
on a point has four points next to him. A black stone is captured by
four white stones taking away its "liberties", i.e., occupying the
empty points adjacent to the black stone. Two black stones at a certain
distance from each other have four liberties twice, but if one places
them next to each other, the number is reduced to six liberties.

This program tries to answer the questions:
What is the minimum number of liberties for 8 stones?
With which arrangement does one achieve this minimum number?

From now on we will only deal with stones of a single color, say,
white stones.

To do this, this program tries all possible configurations of an
8×8 board with eight white stones on the board, that is, the numbers
of liberties for all possible ways to place eight white stones on the
board are calculated.

Whenever a new mininum of the number of liberties or a configuration
with fewer than eleven liberties is found, the configuration is printed.

A configuration of a board is given by specifying for each point
whether there is a white stone on it.

\return 0
*/

int find_solutions( void )
{ int min_liberties = INT_MAX;
uint_fast64_t number_of_configurations_tested = 0;
int output_count = 0;
/* The nested for loops create all possible configurations of eight
stones (the positions of which are called p0, p1, ..., p7) on a board
with 8×8 points. */
for( int p7 = 7; p7 < 64; ++p7 )
for( int p6 = 6; p6 < p7; ++p6 )
for( int p5 = 5; p5 < p6; ++p5 )
for( int p4 = 4; p4 < p5; ++p4 )
for( int p3 = 3; p3 < p4; ++p3 )
for( int p2 = 2; p2 < p3; ++p2 )
for( int p1 = 1; p1 < p2; ++p1 )
for( int p0 = 0; p0 < p1; ++p0 )
{ CONFIGURATION const configuration =
STONE << p0 |
STONE << p1 |
STONE << p2 |
STONE << p3 |
STONE << p4 |
STONE << p5 |
STONE << p6 |
STONE << p7;
++number_of_configurations_tested;
int const number_of_liberties = liberties_of_stones
( configuration );
if( number_of_liberties < min_liberties | number_of_liberties < 11 )
{ min_liberties = number_of_liberties;
printf( "Output #%d\n", output_count++ );
printf( "%d liberties\n", number_of_liberties );
printf
( number_of_configurations_tested == 1 ?
"So far, %" PRIuFAST64 " configuration tested.\n\n" :
"So far, %" PRIuFAST64 " configurations tested.\n\n",
number_of_configurations_tested );
print_configuration( configuration );
printf( "\n" ); }} return 0; }

/** \brief main function, calls @c find_solutions */

int main( void ){ return find_solutions(); }

Re: operator precedence

<20220410094247.215@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21136&group=comp.lang.c#21136

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: 480-992-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Sun, 10 Apr 2022 16:45:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <20220410094247.215@kylheku.com>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2uru3$1isf$1@gioia.aioe.org> <t2utnn$2om55$1@news.xmission.com>
Injection-Date: Sun, 10 Apr 2022 16:45:16 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b60ddff5a79a795cad2b7775c0ab55a2";
logging-data="5949"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/C58CFuTvrEBUqVs+yqgVbKZwrCX3+zh0="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:GpYkJuroeEzzsjgE7kjKf+xlx5Y=
 by: Kaz Kylheku - Sun, 10 Apr 2022 16:45 UTC

On 2022-04-10, Kenny McCormack <gazelle@shell.xmission.com> wrote:
> In article <t2uru3$1isf$1@gioia.aioe.org>,
> Christian Hann <the.hanne@gmail.com> wrote:
>>Am 08.04.2022 um 14:00 schrieb Stefan Ram:
>>> Recently, I wrote:
>>>
>>> board & 1 << row * COLS + col
>>>
>>> . Not knowing the precedence of operators by heart,
>>> I planned to look up the precedence rules and then insert
>>> any necessary parentheses. But then, I had this thought:
>>> "C was made for such expression; just trust the language.".
>>>
>>>
>>
>>Better use C++. With C++ ...
>
> How about Fortran? Or Perl?
>
> I.e., if you're going to suggest other, unrelated languages, why not go for
> the sky?

C++ is not an unrelated language; where you have C++, it is very well
integrated into the platform in that you can directly use header files
and libraries, using their native usage sytnax and all. Toolchains
often have both a C and C++ compiler. It's not unusual to be able to
convert C code to C++ without changing very much (certainly not its
overall organization); the executable is about the same size and
performance, and can have exactly the same dependencies, not to mention
deployment model.

Re: operator precedence

<t2v61c$ej9$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21137&group=comp.lang.c#21137

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!aioe.org!MJfzOZFZvtBCOkfnmkw/6g.user.46.165.242.75.POSTED!not-for-mail
From: mess...@bottle.org (Guillaume)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Sun, 10 Apr 2022 20:01:14 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t2v61c$ej9$1@gioia.aioe.org>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="14953"; posting-host="MJfzOZFZvtBCOkfnmkw/6g.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.8.0
Content-Language: fr
X-Notice: Filtered by postfilter v. 0.9.2
 by: Guillaume - Sun, 10 Apr 2022 18:01 UTC

Le 08/04/2022 à 14:00, Stefan Ram a écrit :
> Recently, I wrote:
>
> board & 1 << row * COLS + col

If I saw this coming from someone in my team, I would probably fire them. =)

I'm not even sure this is correct from what you really intended. But
even if it is, there's a rule in programming, IMO, that's above the
programming language's grammar: readability for us humans.

Code we write is meant for humans, not machines. That's something people
forget way too often. That's why we write using higher-level languages,
not assembly or even machine code. Or, look at the obfuscated C contest
and such. This is proper C from a language standpoint, but nothing you'd
want to deal with.

The readability rule that applies here is, if you need more than a few
seconds figuring out what a given statement exactly does, and may have
to even open the C standard to make sure, then it's badly written.
Rewrite it.

Re: operator precedence

<t2v6o3$gec$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21138&group=comp.lang.c#21138

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: andreyta...@hotmail.com (Andrey Tarasevich)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Sun, 10 Apr 2022 11:13:23 -0700
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <t2v6o3$gec$1@dont-email.me>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2plh1$6fk$1@dont-email.me>
<chine.bleu-08FB27.10100008042022@reader.eternal-september.org>
<dd5d5d14-9d59-407d-a8ac-fb37aad2c711n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 10 Apr 2022 18:13:23 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="83283090fee96abf8d9f5fddee9ded71";
logging-data="16844"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182TJYDkJ3cV4L7fb9SlbSx"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.8.0
Cancel-Lock: sha1:4srJayQL/Y3crbWpAOUzbQ5HbWw=
In-Reply-To: <dd5d5d14-9d59-407d-a8ac-fb37aad2c711n@googlegroups.com>
Content-Language: en-US
 by: Andrey Tarasevich - Sun, 10 Apr 2022 18:13 UTC

On 4/8/2022 8:46 PM, james...@alumni.caltech.edu wrote:
> On Friday, April 8, 2022 at 1:10:22 PM UTC-4, Siri Cruise wrote:
>> In article <t2plh1$6fk$1...@dont-email.me>,
> ...
>> For a time I was thinking of Fortran rules where parentheses can
>> affect order of evaluation. Once I got that clear that
>> parentheses in C have no effect on generated code.
>
> Parentheses don't directly affect order of evaluation. They do,
> however, do something far more important - they can change which
> expressions are sub-expressions of other expressions, which has a
> big effect on the generated code. In `a + b*c`, `b*c` is the right
> operand of the `+` operator; in `(a + b)*c`, `a+b` is the left operand
> of the `*` operator.
>
> As a result, parentheses do indirectly affect the order of evaluation,
> since evaluations of sub-expressions are sequenced before evaluation
> of the expression they are part of. That is not enough to determine
> the order of evaluation, but it does constrain the order.

This is lazy wording, which makes it incorrect. The "subexpression
before expression" sequencing you mention does not cover side effects.
It only covers value computations. What you are trying to say is what
the standard formulates as:

6.5 Expressions
1 [...] The value computations of the operands of an operator are
sequenced before the value computation of the result of the operator.

Note the specific reference to *value computations*. That is the correct
wording.

You can put as many parentheses in your expression as you want, they
won't have any effect on sequencing of side effects. So no, you cannot
just claim that parentheses introduce a "sequenced before" ordering
without explicitly stating that this ordering applies to value
computations only.

And, once again, whatever ordering your parentheses might introduce,
they introduce it in an Abstract C Machine. Until you somehow trace/tie
that ordering to observable behavior, it won't have any connection to
the behavior of your specific real-life compiler and your specific
real-life code.

--
Best regards,
Andrey Tarasevich

Re: operator precedence

<precedence-20220410192504@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21139&group=comp.lang.c#21139

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: 10 Apr 2022 18:25:51 GMT
Organization: Stefan Ram
Lines: 10
Expires: 1 Apr 2023 11:59:58 GMT
Message-ID: <precedence-20220410192504@ram.dialup.fu-berlin.de>
References: <thought-20220408125437@ram.dialup.fu-berlin.de> <t2v61c$ej9$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de eyFPHqOipEMHqP1OErHPXgN6kE6iCUoBkLa5P9cQ+nDBIj
X-Copyright: (C) Copyright 2022 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Sun, 10 Apr 2022 18:25 UTC

Guillaume <message@bottle.org> writes:
>Le 08/04/2022 à 14:00, Stefan Ram a écrit :
>>Recently, I wrote:
>>board & 1 << row * COLS + col
>If I saw this coming from someone in my team, I would probably fire them. =)

I find it cute when programming witlings write down their
fantasies of power. =)

Re: operator precedence

<87bkx868cm.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21141&group=comp.lang.c#21141

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Sun, 10 Apr 2022 20:34:17 +0100
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <87bkx868cm.fsf@bsb.me.uk>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="0edcfd0a497f6252059b74307060f33c";
logging-data="31609"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197uz6R4T511du1nAaozAGy+tgs+glW8hA="
Cancel-Lock: sha1:qdiAxgebH0JKuNmi0BucJbbtyMI=
sha1:U0Hy3DwPf2QLaqQL2vRmNrsh5rk=
X-BSB-Auth: 1.708ffc29e30f5aea7489.20220410203417BST.87bkx868cm.fsf@bsb.me.uk
 by: Ben - Sun, 10 Apr 2022 19:34 UTC

Guillaume <message@bottle.org> writes:

> Le 08/04/2022 à 14:00, Stefan Ram a écrit :
>> Recently, I wrote:
>> board & 1 << row * COLS + col
>
> If I saw this coming from someone in my team, I would probably fire
> them. =)

Why is this such a common trope? I doubt any country has such poor
employment protection that anyone could be fired for such a thing so I
assume it's just a rhetorical device to say "I really care about this
issue", but surely there are other ways to do that without being so
Donal^H^H^H^H Alan Sugar about it.

Anyway, in reality I imagine you'd help your team mate write code that
conforms to whatever standards your employer (or you, if you own the
company) demands, including some answer to the thorny question below.

> The readability rule that applies here is, if you need more than a few
> seconds figuring out what a given statement exactly does, and may have
> to even open the C standard to make sure, then it's badly
> written. Rewrite it.

The trouble with this (since I don't think you literally mean "you"
here) is who is the typical reader? Do you aim for the lowest common
denominator, or something in the middle? Does is vary by team? If it's
a C compiler project, might you assume a higher standard of
comprehension?

--
Ben.

Re: operator precedence

<t2vfvp$cmi$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21142&group=comp.lang.c#21142

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: vir.camp...@invalid.invalid (Vir Campestris)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Sun, 10 Apr 2022 21:51:04 +0100
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <t2vfvp$cmi$1@dont-email.me>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org>
<precedence-20220410192504@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 10 Apr 2022 20:51:05 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="9fcbc9c62606af748018d8f138c3b1a0";
logging-data="13010"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OYiUxVgO3WV1DRZKH91SFqOEDSqx6R48="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Cancel-Lock: sha1:p8ew8Hob84YFOynQldroJCbIhAY=
In-Reply-To: <precedence-20220410192504@ram.dialup.fu-berlin.de>
Content-Language: en-GB
 by: Vir Campestris - Sun, 10 Apr 2022 20:51 UTC

On 10/04/2022 19:25, Stefan Ram wrote:
> Guillaume <message@bottle.org> writes:
>> Le 08/04/2022 à 14:00, Stefan Ram a écrit :
>>> Recently, I wrote:
>>> board & 1 << row * COLS + col
>> If I saw this coming from someone in my team, I would probably fire them. =)
>
> I find it cute when programming witlings write down their
> fantasies of power. =)
>
I don't think I'd fire them. But I think I'd explain that if they really
want to make a career in software engineering they need to understand
that making the program easily understood without ambiguity by everybody
is quite high on the list of requirements.

I'd also be pretty sure that they are early in their career, or they
would have learned that themselves by now. New graduates do need
tuition, and can become good engineers in time.

(IMHO about the only thing APL got right was the precedence. You start
at the end of the statement, and work along. It was the wrong end, but
WTH...)

(also AIUI precedence of operators only came about because
mathematicians like to write a+bc, meaning what we read as a+b*c)

Andy

Re: operator precedence

<87a6csocyx.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21143&group=comp.lang.c#21143

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Sun, 10 Apr 2022 14:17:10 -0700
Organization: None to speak of
Lines: 28
Message-ID: <87a6csocyx.fsf@nosuchdomain.example.com>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2uru3$1isf$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="135db30b784175e4173309be2d7db731";
logging-data="30706"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+GU8qsNG6Ox+f0187kjL1s"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:pauwgEyG7HV8t+bWiHknVwC//+o=
sha1:7b3ZOCpvEH4i95xIMURW/yWW+ew=
 by: Keith Thompson - Sun, 10 Apr 2022 21:17 UTC

Christian Hanné <the.hanne@gmail.com> writes:
> Am 08.04.2022 um 14:00 schrieb Stefan Ram:
>> Recently, I wrote:
>> board & 1 << row * COLS + col
>> . Not knowing the precedence of operators by heart,
>> I planned to look up the precedence rules and then insert
>> any necessary parentheses. But then, I had this thought:
>> "C was made for such expression; just trust the language.".
>>
>
> Better use C++. With C++ you can use operator overloading and
> with operator overloadig you can re-define the operator-precedence.
> F.e. you can write:
>
> unsigned u = 1;
> cout << u << 1 << endl;
> The second << is a shift now!!!

That is a lie. C++ operator overloading does not alter operator
precedence.

Christian Hanné has a pathetic history of posting deliberate
misinformation in comp.lang.c and comp.lang.c++.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: operator precedence

<t30jdp$1h9g$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21144&group=comp.lang.c#21144

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!aioe.org!YgKMkT8Hbhw8vNatTmzQ/w.user.46.165.242.75.POSTED!not-for-mail
From: the.ha...@gmail.com (Christian Hanné)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Mon, 11 Apr 2022 08:56:00 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t30jdp$1h9g$1@gioia.aioe.org>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2uru3$1isf$1@gioia.aioe.org> <87a6csocyx.fsf@nosuchdomain.example.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="50480"; posting-host="YgKMkT8Hbhw8vNatTmzQ/w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Content-Language: de-DE
X-Notice: Filtered by postfilter v. 0.9.2
 by: Christian Hanné - Mon, 11 Apr 2022 06:56 UTC

Am 10.04.2022 um 23:17 schrieb Keith Thompson:
> Christian Hanné <the.hanne@gmail.com> writes:
>> Am 08.04.2022 um 14:00 schrieb Stefan Ram:
>>> Recently, I wrote:
>>> board & 1 << row * COLS + col
>>> . Not knowing the precedence of operators by heart,
>>> I planned to look up the precedence rules and then insert
>>> any necessary parentheses. But then, I had this thought:
>>> "C was made for such expression; just trust the language.".
>>>
>>
>> Better use C++. With C++ you can use operator overloading and
>> with operator overloadig you can re-define the operator-precedence.
>> F.e. you can write:
>>
>> unsigned u = 1;
>> cout << u << 1 << endl;
>> The second << is a shift now!!!
>
> That is a lie. C++ operator overloading does not alter operator
> precedence.

C++ allows defining your own operator-predence priorities since C++17.

Re: operator precedence

<t30som$f7a$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21146&group=comp.lang.c#21146

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Mon, 11 Apr 2022 11:35:24 +0200
Organization: A noiseless patient Spider
Lines: 1
Message-ID: <t30som$f7a$1@dont-email.me>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 11 Apr 2022 09:35:18 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="d40cf4843ccb6d7d7a9138e634b30061";
logging-data="15594"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19LMuw1ooKyLsfIpZGtGQ1ZeC/M+07SS6c="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.8.0
Cancel-Lock: sha1:uew5lcuN4Ei9nm8c/2xxLqOFKtA=
In-Reply-To: <t2v61c$ej9$1@gioia.aioe.org>
Content-Language: de-DE
 by: Bonita Montero - Mon, 11 Apr 2022 09:35 UTC

Knowing the operator precedence is as essential as literacy.

Re: operator precedence

<precedence-20220411141849@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21147&group=comp.lang.c#21147

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: 11 Apr 2022 13:27:00 GMT
Organization: Stefan Ram
Lines: 38
Expires: 1 Apr 2023 11:59:58 GMT
Message-ID: <precedence-20220411141849@ram.dialup.fu-berlin.de>
References: <thought-20220408125437@ram.dialup.fu-berlin.de> <t2v61c$ej9$1@gioia.aioe.org> <precedence-20220410192504@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de /iPtDfd1wi6O2HrViS3bTA//kqcEHmRKmH1pgxsv4IrmLV
X-Copyright: (C) Copyright 2022 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Mon, 11 Apr 2022 13:27 UTC

ram@zedat.fu-berlin.de (Stefan Ram) writes:
>Guillaume <message@bottle.org> writes:
>>Le 08/04/2022 à 14:00, Stefan Ram a écrit :
>>>Recently, I wrote:
>>>board & 1 << row * COLS + col
>>If I saw this coming from someone in my team, I would probably fire them. =)
>I find it cute when programming witlings write down their
>fantasies of power. =)

Could you play this sonata for us?

Pianist plays the Beethoven Sonata from memory.
(He also knows some other pieces by heart.)

Could you translate this sentence for us?

Translator translates the sentence, after having learned
more than 10000 words, many of which have several forms
and meanings, idioms, and complex rules of grammar and
usage.

Could you explain "a & b << c + 1" for us?

Look Sir, I'm a professional C programmer, doing this eight
hours a day, 40 hours a week, for many years. But C has
about 17 levels of precedence! Memorizing all of them is
simply beyond human capabilities! So please give me some parens.
I would say, otherwise, you would be to blame for having
written such a cluttered mess!

~~~

C is a language with some subtleties, and programming often
is somewhat complex overall. If you don't trust a C programmer
to even get an expression as simple as "a & b << c + 1",
how is he supposed to get more subtle things right?

Pages:1234
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor