Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

A complex system that works is invariably found to have evolved from a simple system that works.


devel / comp.lang.c / Re: 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
Re: operator precedence

<4dbe7bb8-f374-47db-aa17-e5dfaad0fd7en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:4e46:0:b0:2e1:b933:ec06 with SMTP id e6-20020ac84e46000000b002e1b933ec06mr22515621qtw.684.1651144621160;
Thu, 28 Apr 2022 04:17:01 -0700 (PDT)
X-Received: by 2002:a05:6214:e4a:b0:449:99fd:bff7 with SMTP id
o10-20020a0562140e4a00b0044999fdbff7mr23486393qvc.46.1651144620949; Thu, 28
Apr 2022 04:17:00 -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: Thu, 28 Apr 2022 04:17:00 -0700 (PDT)
In-Reply-To: <t4drth$mng$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:a0d7:a28a:22c5:f653;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:a0d7:a28a:22c5:f653
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk> <t48s6g$4ir$1@dont-email.me>
<87v8uvq4bv.fsf@bsb.me.uk> <t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk> <t4di33$48o$1@dont-email.me>
<871qxhmtjo.fsf@bsb.me.uk> <t4dohv$mmk$1@dont-email.me> <t4dqav$sjd$1@milena.home.net.it>
<t4drth$mng$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4dbe7bb8-f374-47db-aa17-e5dfaad0fd7en@googlegroups.com>
Subject: Re: operator precedence
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Thu, 28 Apr 2022 11:17:01 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 29
 by: Malcolm McLean - Thu, 28 Apr 2022 11:17 UTC

On Thursday, 28 April 2022 at 11:57:03 UTC+1, David Brown wrote:
> On 28/04/2022 12:29, Giovanni wrote:
> > On 4/28/22 11:59, David Brown wrote:
> >
> >> Humans can make interpretations like that - a compiler cannot.
> >
> > Humans _can_ but not all humans do. I would interpret
> > 10 × 2+3 as (10 x 2)+3
> > This was the basic rule I learned at the times of primary school.
> >
> That is the rule, yes. But if someone else wrote it with such spacing,
> would you not think that perhaps they meant it to be interpreted as
> though they had written "(10 × 2) + 3" ? When faced with something that
> has a conflict between the layout and the standard rules for
> mathematics, you know something is not right - but as a human reader you
> need to make a judgement as to what you think is wrong, and correct for
> that. And you do this in a different way than a computer or compiler does..
>
Yes you would. You'd wonder what was going on. Especially since, except in
classroom exercises, mathematical expressions have a context. If the room
is ten metres long and has a wooden strip two metres wide and a carpet
three metres wide, and the context is how much carpet to buy, then you would
suspect that 10 x (2 + 3) is intended. However maybe they only intend to carpet
the wooden strip and are allowing 3 square metres for offcuts.

Re: operator precedence

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

  copy mid

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

  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: Thu, 28 Apr 2022 12:24:52 +0100
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <87ee1hlabf.fsf@bsb.me.uk>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk>
<t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk>
<t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk>
<t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk>
<t4dohv$mmk$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="78d270a39e8aac3e13f55e3de1875d63";
logging-data="32331"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18pk166ah26V2Ck716gqldXe5FOUwtiwbk="
Cancel-Lock: sha1:cqD82sJJYuIS8byaToEpsL7IwQg=
sha1:VY1zfDurq0EoWAJ8c2rIhHp+t8U=
X-BSB-Auth: 1.3b3fa40f9e020cacecad.20220428122452BST.87ee1hlabf.fsf@bsb.me.uk
 by: Ben - Thu, 28 Apr 2022 11:24 UTC

David Brown <david.brown@hesbynett.no> writes:

> On 28/04/2022 11:44, Ben wrote:
>> David Brown <david.brown@hesbynett.no> writes:
>>
>>> On 27/04/2022 20:43, Ben wrote:
>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>
>>>>> You don't need parenthesis because in written mathematics, size of
>>>>> spacing /is/ significant.
>>>> Is it? Where can I find out about this?
>>>>
>>>
>>> I mean the way you space things in how you write mathematics gives
>>> additional information, in a way that cannot be done in a programming
>>> language.
>>>
>>> If you see mathematics written :
>>>
>>> 10 × 2+3
>>>
>>> you'll interpret it differently from :
>>>
>>> 10×2 + 3
>>
>> Where does this come from? It's news to me. Where did you find out
>> about it?
>
> I think you are reading too much into this. To my knowledge, there is
> no ISO Mathematics Standard document we can refer to. Written
> mathematics is written by people, and read by people, as a method of
> communication between humans. The way it is laid out, including the
> spacing, is part of that. Spacing can make it clear what the writer
> /intended/ even if it is not what what was actually /written/. Humans
> can make interpretations like that - a compiler cannot.

I get that. I never thought there were rules. But somehow you learned
something that I didn't. I would never say "You don't need parenthesis
because in written mathematics, size of spacing /is/ significant" so I
wondered how you came to know that.

Maybe you just read a book once and thought "that would need ()s if it
weren't for the spaces" but I don't recall ever seeing such a thing. My
experience has led to think that spacing and layout are only for
clarity, so your first example just looks wrong. If I saw it in a book
I'd make a marginal note (like "!") and consider writing to the
publisher. Would the publisher write back and say "where did you learn
mathematics, kid? There are places where you don't need parentheses
because size of spacing is significant."?

--
Ben.

Re: operator precedence

<typography-20220428124420@ram.dialup.fu-berlin.de>

  copy mid

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

  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: 28 Apr 2022 11:52:47 GMT
Organization: Stefan Ram
Lines: 35
Expires: 1 Apr 2023 11:59:58 GMT
Message-ID: <typography-20220428124420@ram.dialup.fu-berlin.de>
References: <thought-20220408125437@ram.dialup.fu-berlin.de> <t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com> <t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk> <t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk> <t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net> <t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk> <t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk> <t4dohv$mmk$1@dont-email.me> <t4dqav$sjd$1@milena.home.net.it>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de koZ7H5T3uj1xt163SZkOxQJflZbY8S20eEhQEj4O8n5i4B
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 - Thu, 28 Apr 2022 11:52 UTC

Giovanni <lsodgf0@home.net.it> writes:
>Humans _can_ but not all humans do. I would interpret
> 10 × 2+3 as (10 x 2)+3

You would be right!

Usually, one would typeset this as "10 x 2 + 3" using a
distance of 4/18 em instead of the spaces. Binary operators
are sorrounded by 4/18 em, except the slash for division,
which is not sorrounded by any space. When numbers are
combined with letters as in "2x" (meaning "two times x"),
there is also no space added.

My German-language page about typography has some notes
about this:

https://www.purl.org/stefan_ram/pub/schriftsatz

. In C, I am using my personal formatting style, which
in this case would also be "10 * 2 + 3", or maybe, but
more rarely, "10*2 + 3".

In Python, by PEP 8 IIRC, "10*2 + 3" would be recommended.

PEP 8 might say something like,

|If operators with different priorities are used, consider
|adding whitespace around the operators with the lowest
|priority(ies). Use your own judgment; however, never use more
|than one space, and always have the same amount of whitespace
|on both sides of a binary operator.

.

Re: operator precedence

<t4e18p$to$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Thu, 28 Apr 2022 14:28:08 +0200
Organization: A noiseless patient Spider
Lines: 73
Message-ID: <t4e18p$to$1@dont-email.me>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk>
<t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk>
<t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk>
<t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk>
<t4dohv$mmk$1@dont-email.me> <87ee1hlabf.fsf@bsb.me.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 28 Apr 2022 12:28:09 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="8d8f24825e5730f4bfa59a4b1fa7d8e1";
logging-data="952"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kvgBjjaxftXA5pkiGOafe0eeLLVolwOA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Cancel-Lock: sha1:g1sQL/GVZUIE/fJt7o3ETzcNpe8=
In-Reply-To: <87ee1hlabf.fsf@bsb.me.uk>
Content-Language: en-GB
 by: David Brown - Thu, 28 Apr 2022 12:28 UTC

On 28/04/2022 13:24, Ben wrote:
> David Brown <david.brown@hesbynett.no> writes:
>
>> On 28/04/2022 11:44, Ben wrote:
>>> David Brown <david.brown@hesbynett.no> writes:
>>>
>>>> On 27/04/2022 20:43, Ben wrote:
>>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>>
>>>>>> You don't need parenthesis because in written mathematics, size of
>>>>>> spacing /is/ significant.
>>>>> Is it? Where can I find out about this?
>>>>>
>>>>
>>>> I mean the way you space things in how you write mathematics gives
>>>> additional information, in a way that cannot be done in a programming
>>>> language.
>>>>
>>>> If you see mathematics written :
>>>>
>>>> 10 × 2+3
>>>>
>>>> you'll interpret it differently from :
>>>>
>>>> 10×2 + 3
>>>
>>> Where does this come from? It's news to me. Where did you find out
>>> about it?
>>
>> I think you are reading too much into this. To my knowledge, there is
>> no ISO Mathematics Standard document we can refer to. Written
>> mathematics is written by people, and read by people, as a method of
>> communication between humans. The way it is laid out, including the
>> spacing, is part of that. Spacing can make it clear what the writer
>> /intended/ even if it is not what what was actually /written/. Humans
>> can make interpretations like that - a compiler cannot.
>
> I get that. I never thought there were rules. But somehow you learned
> something that I didn't. I would never say "You don't need parenthesis
> because in written mathematics, size of spacing /is/ significant" so I
> wondered how you came to know that.

I get the feeling that we've been talking past each other a bit in this
thread - something has been lost along the way (and I don't think my
examples have helped in the slightest).

The original example was "8 / 2 * (2 + 2)". The standard mathematics
rule would be to read that as "(8 / 2) * 4", rather than "8 / (2 * 4)".
The poster who picked that example said some mathematicians would say
it was ambiguous. I said that in written mathematics, spacing and
layout could resolve any ambiguity about what was meant, but that would
not work in a programming language - it requires human interpretation of
the writer's intent.

I did not intend to imply that spacing can replace the need for
parentheses in general - merely that spacing and layout in written
mathematics can give additional information that can aid understanding.

As another example (assuming my Unicode comes through correctly), how
would you interpret these:

a) ½π

b) 1 / 2π

c) 1/2 π

d) 1
--

Re: operator precedence

<slrnt6l7fp.skc.dan@djph.net>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dan...@djph.net (Dan Purgert)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Thu, 28 Apr 2022 14:00:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <slrnt6l7fp.skc.dan@djph.net>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk>
<t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk>
<t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk>
<t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk>
<t4dohv$mmk$1@dont-email.me> <87ee1hlabf.fsf@bsb.me.uk>
<t4e18p$to$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 28 Apr 2022 14:00:25 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e576fb2de9223141a4ce18e5962ae156";
logging-data="30352"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7EJ2g6cYPaE3C2u14LYWxb+axucNLIj4="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:zktf3QvSLn0jaGIfzojU8YbwD6w=
X-PGP-KeyID: 0x4CE72860
 by: Dan Purgert - Thu, 28 Apr 2022 14:00 UTC

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

David Brown wrote:
> [...]
> The original example was "8 / 2 * (2 + 2)". The standard mathematics
> rule would be to read that as "(8 / 2) * 4", rather than "8 / (2 * 4)".
> The poster who picked that example said some mathematicians would say
> it was ambiguous.

Those mathematicians must not have been paying attention in class :).

> [...]
> I did not intend to imply that spacing can replace the need for
> parentheses in general - merely that spacing and layout in written
> mathematics can give additional information that can aid understanding.
>
> As another example (assuming my Unicode comes through correctly), how
> would you interpret these:
>
> a) ½π
>
> b) 1 / 2π
>
> c) 1/2 π
>
> d) 1
> --
> 2π
>

As written, given my (fuzzy) recollection of gradeschool mathematics,
whitespace doesn't matter and therefore, (b), (c), and (d) are all
equivalent. It's why we use parenthesis or decimals (and I got yelled
at for writing things like 1/4x instead of 0.25x or (1/4)x ).

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE3asj+xn6fYUcweBnbWVw5UznKGAFAmJqnfkACgkQbWVw5Uzn
KGCFNQ/+KI+QA2fWLTUAdGVzzRbnc8QLAB3vzGsxQYUI9GFe4Q1jfdj6cuH8hWBP
iLzLiFn81cJ2J1pHp7xXPVwy0Qai+esfgCZnoZag68cXiV7HgIKn/bFRnAkBqRR2
+Qg7XatNQ0tEtIviDj8aHIXFX8ZCCrwRg3AVOhG5//5wvBk/Y6l/xhKL+u1CSCF2
1huYYz1UOni1zjsXOsVrujf7BamgjcrMI/S2YQeH1AlhPCzbzMoMXek2BMBHKFoQ
JNOXSRoqcWQRJ2LRK3pcmtk5xz76ZITyMKiLq2nwK3lLzLIvdundSO1djIfxcnkV
TNeGn+kdq5LLkWiGaSLqvnDlhzNbcna0XucmInjaDX7AOcNPyU9GXEZvrkdx6fSl
XPUIScmP8C0TxlyfGg3y/I/M2trV/xXESfU56q5xKf99jBF0SL/uypr30t8IE4Az
M3WMxu9+P8LZqFbVoWDoo29WXXyJtvPpd2K+xbIHLAW+S5hHkAWenj99i1BpmBZX
Gw9mVI7WG97JpVdiFveoeOm08NIrn7RQYfFyruvXgkTDM/gdaN2FHTLRjs2KInUc
ZbAbwTXqGtu7rx0XWjc+jIQLMJqBfCCidAEz1xfnM0oKSKIdnEIG7kZuqLJU+I1f
u7e/Ic9clzrrvmFSQLgOBuae0tKj3CN1afB3M46UBTcB1ptiUUA=
=nVPO
-----END PGP SIGNATURE-----

--
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1 E067 6D65 70E5 4CE7 2860

Re: operator precedence

<parens-20220428152120@ram.dialup.fu-berlin.de>

  copy mid

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

  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: 28 Apr 2022 14:25:58 GMT
Organization: Stefan Ram
Lines: 18
Expires: 1 Apr 2023 11:59:58 GMT
Message-ID: <parens-20220428152120@ram.dialup.fu-berlin.de>
References: <thought-20220408125437@ram.dialup.fu-berlin.de> <t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com> <t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk> <t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk> <t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net> <t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk> <t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk> <t4dohv$mmk$1@dont-email.me> <87ee1hlabf.fsf@bsb.me.uk> <t4e18p$to$1@dont-email.me> <slrnt6l7fp.skc.dan@djph.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de nD2Ln/JhTbymvk8rkmlBBQruWHCF9bb/oBJH4v15mp+HOv
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 - Thu, 28 Apr 2022 14:25 UTC

Dan Purgert <dan@djph.net> writes:
>It's why we use parenthesis

Yes. To clarify the precedence, there are parentheses;
whitespace is not intended for this.

"Parenthesis" is the singular; for the plural, you can use
"parentheses" or "parens".

parenthesis  pə ˈɹɛnθ əs ɩs
parentheses (plural) pə ˈɹɛnθ ə sɪːiz

Symbols as in the International Phonetic Alphabet, except:
ɹ American r sound
ᴇ a sound between [e] and [ɛ], usually transcribed as either [e] or [ɛ]
ɩ more open and back than [i], between [i] and [ə], an unrounded [Y]

Re: operator precedence

<slrnt6l9o1.skc.dan@djph.net>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dan...@djph.net (Dan Purgert)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Thu, 28 Apr 2022 14:38:56 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <slrnt6l9o1.skc.dan@djph.net>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk>
<t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk>
<t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk>
<t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk>
<t4dohv$mmk$1@dont-email.me> <87ee1hlabf.fsf@bsb.me.uk>
<t4e18p$to$1@dont-email.me> <slrnt6l7fp.skc.dan@djph.net>
<parens-20220428152120@ram.dialup.fu-berlin.de>
Injection-Date: Thu, 28 Apr 2022 14:38:56 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e576fb2de9223141a4ce18e5962ae156";
logging-data="532"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX180RydD1NTcvWGH1S2mi+vt4bmmy0Eo8NE="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:b6sxbe38b0Y6Lica8wWf1fjfxdI=
X-PGP-KeyID: 0x4CE72860
 by: Dan Purgert - Thu, 28 Apr 2022 14:38 UTC

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Stefan Ram wrote:
> Dan Purgert <dan@djph.net> writes:
>>It's why we use parenthesis
>
> Yes. To clarify the precedence, there are parentheses;
> whitespace is not intended for this.
>
> "Parenthesis" is the singular; for the plural, you can use
> "parentheses" or "parens".

Seems "spelling" is also not a strong suit of mine today :)

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE3asj+xn6fYUcweBnbWVw5UznKGAFAmJqpwEACgkQbWVw5Uzn
KGCHBg/9EK0epr99RIoVS2dCJDNpy8FtQXjJfjodIkIvMDMxThd4YkGgy/b/aEHV
qAFSqOIe/AZ5hLEZPeIxToH7Mu9QmAr6lQpfxESdSWI7XqJDnaeth8rIbO4ZLApe
V/tFM4k5GBcK9nMACqVOxxWFdSnGUTZhsEo9O1wwGxFG1FPUQxscLx/3KNjxrcv2
WzSSYBfvgoBQMzsIpi6F36Yb7U7PQ/ygaWe7tM+UdVuxK3WLTufBaRgKR3YPGOv7
ldcAiHEhGzawZhPl99ARnO6VrUBPTyru8vjhmex27Rfz6SpTDM5DY6k+TAeO5aMI
R0te1lGOgGiedWl8iaByXalWbWubTFyPHyk5LEQNOLizS3tINwDjhbkrAsHm6Nb+
XO07B1E7nkc9H+FbVTalzJL6gR9aE8XyNBYnWcTb3v0oWw/NF+laP0eqP158VtYa
MucOj+p32mou4RDJAW+jpz1wxwZ1B5NGbzENwpMX7LuV99PYVPYht6HLw8S7Lcfg
4uSQivsIQeretY+QYclOkPSojP/CNIdSzLmqeTE0LboxTYe0pC1RVarhdNhJIahq
cgWXJF2ZS5RuXhqkQb4+LNGWYrGe0q11k5/PNsoavS5QymnnO7e2qJaF57MdZIDs
yFCkMpMrNl1mkYOiwSxzS2wUlCqSOHY/VALspPAfGADteJNYXRk=
=F0bk
-----END PGP SIGNATURE-----

--
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1 E067 6D65 70E5 4CE7 2860

Re: operator precedence

<8735hxknkg.fsf@bsb.me.uk>

  copy mid

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

  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: Thu, 28 Apr 2022 20:36:15 +0100
Organization: A noiseless patient Spider
Lines: 87
Message-ID: <8735hxknkg.fsf@bsb.me.uk>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk>
<t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk>
<t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk>
<t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk>
<t4dohv$mmk$1@dont-email.me> <87ee1hlabf.fsf@bsb.me.uk>
<t4e18p$to$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="78d270a39e8aac3e13f55e3de1875d63";
logging-data="14872"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QS8ib2QjLlwkKW1HRs1vd/PsCptpWCt8="
Cancel-Lock: sha1:A887pTJHqjmbfApVoQMIyJ24FrQ=
sha1:0bN6mHNWDLXsJKREkx3YpiCROuU=
X-BSB-Auth: 1.f73569672bb99e8a957b.20220428203615BST.8735hxknkg.fsf@bsb.me.uk
 by: Ben - Thu, 28 Apr 2022 19:36 UTC

David Brown <david.brown@hesbynett.no> writes:

> On 28/04/2022 13:24, Ben wrote:
>> David Brown <david.brown@hesbynett.no> writes:
>>
>>> On 28/04/2022 11:44, Ben wrote:
>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>
>>>>> On 27/04/2022 20:43, Ben wrote:
>>>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>>>
>>>>>>> You don't need parenthesis because in written mathematics, size of
>>>>>>> spacing /is/ significant.
>>>>>> Is it? Where can I find out about this?
>>>>>>
>>>>>
>>>>> I mean the way you space things in how you write mathematics gives
>>>>> additional information, in a way that cannot be done in a programming
>>>>> language.
>>>>>
>>>>> If you see mathematics written :
>>>>>
>>>>> 10 × 2+3
>>>>>
>>>>> you'll interpret it differently from :
>>>>>
>>>>> 10×2 + 3
>>>>
>>>> Where does this come from? It's news to me. Where did you find out
>>>> about it?
>>>
>>> I think you are reading too much into this. To my knowledge, there is
>>> no ISO Mathematics Standard document we can refer to. Written
>>> mathematics is written by people, and read by people, as a method of
>>> communication between humans. The way it is laid out, including the
>>> spacing, is part of that. Spacing can make it clear what the writer
>>> /intended/ even if it is not what what was actually /written/. Humans
>>> can make interpretations like that - a compiler cannot.
>>
>> I get that. I never thought there were rules. But somehow you learned
>> something that I didn't. I would never say "You don't need parenthesis
>> because in written mathematics, size of spacing /is/ significant" so I
>> wondered how you came to know that.
>
> I get the feeling that we've been talking past each other a bit in
> this thread - something has been lost along the way (and I don't think
> my examples have helped in the slightest).
>
> The original example was "8 / 2 * (2 + 2)". The standard mathematics
> rule would be to read that as "(8 / 2) * 4", rather than "8 / (2 *
> 4)". The poster who picked that example said some mathematicians
> would say it was ambiguous. I said that in written mathematics,
> spacing and layout could resolve any ambiguity about what was meant,

The layout, yes. That's not the point that got my attention.

> but that would not work in a programming language - it requires human
> interpretation of the writer's intent.
>
> I did not intend to imply that spacing can replace the need for
> parentheses in general - merely that spacing and layout in written
> mathematics can give additional information that can aid
> understanding.

I didn't think you meant in general. I am sure something like that
would not have escaped my attention.

> As another example (assuming my Unicode comes through correctly), how
> would you interpret these:
>
> a) ½π
>
> b) 1 / 2π
>
> c) 1/2 π
>
> d) 1
> --
> 2π

Were you talking about "typed" mathematics? Because ASCII symbols like / are
ambiguous -- they are used to form fractions and also for division.
Your remark seemed very much to be about mathematics as it is properly
written.

--
Ben.

Re: operator precedence

<t4et2j$dml$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: richard....@gmail.com (Richard Harnden)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Thu, 28 Apr 2022 21:22:42 +0100
Organization: A noiseless patient Spider
Lines: 104
Message-ID: <t4et2j$dml$1@dont-email.me>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk>
<t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk>
<t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk>
<t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk>
<t4dohv$mmk$1@dont-email.me> <87ee1hlabf.fsf@bsb.me.uk>
<t4e18p$to$1@dont-email.me>
Reply-To: nospam.harnden@gmail.com
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 28 Apr 2022 20:22:43 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="eadc3e8d2cdf1c508af0e30ed2536024";
logging-data="14037"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WKPgYCBf2OzgK5XcZdxnYg/4mXy5Vrps="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.8.1
Cancel-Lock: sha1:tglKJ8FYDVBy2xAMkwJD4LyKApg=
In-Reply-To: <t4e18p$to$1@dont-email.me>
 by: Richard Harnden - Thu, 28 Apr 2022 20:22 UTC

On 28/04/2022 13:28, David Brown wrote:
> On 28/04/2022 13:24, Ben wrote:
>> David Brown <david.brown@hesbynett.no> writes:
>>
>>> On 28/04/2022 11:44, Ben wrote:
>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>
>>>>> On 27/04/2022 20:43, Ben wrote:
>>>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>>>
>>>>>>> You don't need parenthesis because in written mathematics, size of
>>>>>>> spacing /is/ significant.
>>>>>> Is it?  Where can I find out about this?
>>>>>>
>>>>>
>>>>> I mean the way you space things in how you write mathematics gives
>>>>> additional information, in a way that cannot be done in a programming
>>>>> language.
>>>>>
>>>>> If you see mathematics written :
>>>>>
>>>>>     10  ×  2+3
>>>>>
>>>>> you'll interpret it differently from :
>>>>>
>>>>>     10×2 + 3
>>>>
>>>> Where does this come from?  It's news to me.  Where did you find out
>>>> about it?
>>>
>>> I think you are reading too much into this.  To my knowledge, there is
>>> no ISO Mathematics Standard document we can refer to.  Written
>>> mathematics is written by people, and read by people, as a method of
>>> communication between humans.  The way it is laid out, including the
>>> spacing, is part of that.  Spacing can make it clear what the writer
>>> /intended/ even if it is not what what was actually /written/.  Humans
>>> can make interpretations like that - a compiler cannot.
>>
>> I get that.  I never thought there were rules.  But somehow you learned
>> something that I didn't.  I would never say "You don't need parenthesis
>> because in written mathematics, size of spacing /is/ significant" so I
>> wondered how you came to know that.
>
> I get the feeling that we've been talking past each other a bit in this
> thread - something has been lost along the way (and I don't think my
> examples have helped in the slightest).
>
> The original example was "8 / 2 * (2 + 2)".  The standard mathematics
> rule would be to read that as "(8 / 2) * 4", rather than "8 / (2 * 4)".
>  The poster who picked that example said some mathematicians would say
> it was ambiguous.  I said that in written mathematics, spacing and
> layout could resolve any ambiguity about what was meant, but that would
> not work in a programming language - it requires human interpretation of
> the writer's intent.
>
> I did not intend to imply that spacing can replace the need for
> parentheses in general - merely that spacing and layout in written
> mathematics can give additional information that can aid understanding.
>
> As another example (assuming my Unicode comes through correctly), how
> would you interpret these:

I read them like ...

>
> a)    ½π

(1/2)π

>
> b)    1 / 2π

1/(2π)

>
> c)    1/2 π

same as a)

>
> d)    1
>     --
>     2π

same as b)

On the blackboard, a) and c) would be more like:

π
---
2

or

π/2

and, b) and d) as d) was written.

At the end of the day, extra parens - even if not strictly necessary -
is not a sign of weakness.

Re: operator precedence

<20220428134915.360@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!rocksolid2!i2pn.org!weretis.net!feeder8.news.weretis.net!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: Thu, 28 Apr 2022 20:51:17 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <20220428134915.360@kylheku.com>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk>
<t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk>
<t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk>
<t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 28 Apr 2022 20:51:17 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e5d47889cabf527ae130641665a30c7e";
logging-data="14677"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+VZ50YU/T7JqlkN2YBpsfVLRE1zYJ1jOs="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:kAgNjGSsslPTIiICltKZEPQdEgA=
 by: Kaz Kylheku - Thu, 28 Apr 2022 20:51 UTC

On 2022-04-28, Ben <ben.usenet@bsb.me.uk> wrote:
> David Brown <david.brown@hesbynett.no> writes:
>
>> On 27/04/2022 20:43, Ben wrote:
>>> David Brown <david.brown@hesbynett.no> writes:
>>>
>>>> You don't need parenthesis because in written mathematics, size of
>>>> spacing /is/ significant.
>>> Is it? Where can I find out about this?
>>>
>>
>> I mean the way you space things in how you write mathematics gives
>> additional information, in a way that cannot be done in a programming
>> language.
>>
>> If you see mathematics written :
>>
>> 10 × 2+3
>>
>> you'll interpret it differently from :
>>
>> 10×2 + 3
>
> Where does this come from?

Human error; some people will make the mistake some of the time
due to following visual clues over formal syntax, mistaking
closer spacing for tighter binding.

It't the same as:

char* p, q; // oops, q is of type char, not char *.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: operator precedence

<t4g4uk$e0u$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Fri, 29 Apr 2022 09:43:16 +0200
Organization: A noiseless patient Spider
Lines: 108
Message-ID: <t4g4uk$e0u$1@dont-email.me>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk>
<t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk>
<t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk>
<t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk>
<t4dohv$mmk$1@dont-email.me> <87ee1hlabf.fsf@bsb.me.uk>
<t4e18p$to$1@dont-email.me> <t4et2j$dml$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 29 Apr 2022 07:43:16 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="72344bf05fd471255637471cda595b07";
logging-data="14366"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WEWISIYGR8u+URDDiCa0RtfHrBYXQgew="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Cancel-Lock: sha1:VRBp9aF9ryYwa9SRKS+ui1CRctQ=
In-Reply-To: <t4et2j$dml$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Fri, 29 Apr 2022 07:43 UTC

On 28/04/2022 22:22, Richard Harnden wrote:
> On 28/04/2022 13:28, David Brown wrote:
>> On 28/04/2022 13:24, Ben wrote:
>>> David Brown <david.brown@hesbynett.no> writes:
>>>
>>>> On 28/04/2022 11:44, Ben wrote:
>>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>>
>>>>>> On 27/04/2022 20:43, Ben wrote:
>>>>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>>>>
>>>>>>>> You don't need parenthesis because in written mathematics, size of
>>>>>>>> spacing /is/ significant.
>>>>>>> Is it?  Where can I find out about this?
>>>>>>>
>>>>>>
>>>>>> I mean the way you space things in how you write mathematics gives
>>>>>> additional information, in a way that cannot be done in a programming
>>>>>> language.
>>>>>>
>>>>>> If you see mathematics written :
>>>>>>
>>>>>>     10  ×  2+3
>>>>>>
>>>>>> you'll interpret it differently from :
>>>>>>
>>>>>>     10×2 + 3
>>>>>
>>>>> Where does this come from?  It's news to me.  Where did you find out
>>>>> about it?
>>>>
>>>> I think you are reading too much into this.  To my knowledge, there is
>>>> no ISO Mathematics Standard document we can refer to.  Written
>>>> mathematics is written by people, and read by people, as a method of
>>>> communication between humans.  The way it is laid out, including the
>>>> spacing, is part of that.  Spacing can make it clear what the writer
>>>> /intended/ even if it is not what what was actually /written/.  Humans
>>>> can make interpretations like that - a compiler cannot.
>>>
>>> I get that.  I never thought there were rules.  But somehow you learned
>>> something that I didn't.  I would never say "You don't need parenthesis
>>> because in written mathematics, size of spacing /is/ significant" so I
>>> wondered how you came to know that.
>>
>> I get the feeling that we've been talking past each other a bit in
>> this thread - something has been lost along the way (and I don't think
>> my examples have helped in the slightest).
>>
>> The original example was "8 / 2 * (2 + 2)".  The standard mathematics
>> rule would be to read that as "(8 / 2) * 4", rather than "8 / (2 *
>> 4)".   The poster who picked that example said some mathematicians
>> would say it was ambiguous.  I said that in written mathematics,
>> spacing and layout could resolve any ambiguity about what was meant,
>> but that would not work in a programming language - it requires human
>> interpretation of the writer's intent.
>>
>> I did not intend to imply that spacing can replace the need for
>> parentheses in general - merely that spacing and layout in written
>> mathematics can give additional information that can aid understanding.
>>
>> As another example (assuming my Unicode comes through correctly), how
>> would you interpret these:
>
> I read them like ...
>
>>
>> a)    ½π
>
> (1/2)π
>
>>
>> b)    1 / 2π
>
> 1/(2π)
>
>>
>> c)    1/2 π
>
> same as a)
>
>>
>> d)    1
>>      --
>>      2π
>
> same as b)
>
>
> On the blackboard, a) and c) would be more like:
>
>  π
> ---
>  2
>
> or
>
> π/2
>
>
> and, b) and d) as d) was written.
>
>
> At the end of the day, extra parens - even if not strictly necessary -
> is not a sign of weakness.
>

Agreed on all points.

Re: operator precedence

<t4g66o$otp$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Fri, 29 Apr 2022 10:04:39 +0200
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <t4g66o$otp$1@dont-email.me>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk>
<t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk>
<t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk>
<t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk>
<20220428134915.360@kylheku.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 29 Apr 2022 08:04:40 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="72344bf05fd471255637471cda595b07";
logging-data="25529"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/NK3Xy5nKtWQx8J77ORwIVFchgBtvqPCQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Cancel-Lock: sha1:ipjmoPMxSP1dF/70nTP33CbGqI4=
In-Reply-To: <20220428134915.360@kylheku.com>
Content-Language: en-GB
 by: David Brown - Fri, 29 Apr 2022 08:04 UTC

On 28/04/2022 22:51, Kaz Kylheku wrote:
> On 2022-04-28, Ben <ben.usenet@bsb.me.uk> wrote:
>> David Brown <david.brown@hesbynett.no> writes:
>>
>>> On 27/04/2022 20:43, Ben wrote:
>>>> David Brown <david.brown@hesbynett.no> writes:
>>>>
>>>>> You don't need parenthesis because in written mathematics, size of
>>>>> spacing /is/ significant.
>>>> Is it? Where can I find out about this?
>>>>
>>>
>>> I mean the way you space things in how you write mathematics gives
>>> additional information, in a way that cannot be done in a programming
>>> language.
>>>
>>> If you see mathematics written :
>>>
>>> 10 × 2+3
>>>
>>> you'll interpret it differently from :
>>>
>>> 10×2 + 3
>>
>> Where does this come from?
>
> Human error; some people will make the mistake some of the time
> due to following visual clues over formal syntax, mistaking
> closer spacing for tighter binding.
>
> It't the same as:
>
> char* p, q; // oops, q is of type char, not char *.
>
>

Yes.

Spacing influences how people read things - it is significant to people.
It does not affect how the compiler sees things (once you have the
bare minimum for the syntax, of course). So IMHO using spacing as an
extra clue to intent is useful in written mathematics, but can be
directly counter-productive in programming - it is akin to using
comments to say something that could be better expressed in code. Of
course you should still use spacing to make things as clear as you
reasonably can (and thus write "char *p, q;" - though it is usually much
better to write them separately as "char *p; char q;"). But it is a
mistake to use human-only indicators of intent when you can use
something that is interpreted equally by humans and the compiler.

Re: operator precedence

<a7dacaa3-157a-4fbe-84e2-c2e006f34afdn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:19ca:b0:456:39e3:d4a0 with SMTP id j10-20020a05621419ca00b0045639e3d4a0mr17192243qvc.114.1651226495365;
Fri, 29 Apr 2022 03:01:35 -0700 (PDT)
X-Received: by 2002:a05:622a:181a:b0:2f3:93ac:6859 with SMTP id
t26-20020a05622a181a00b002f393ac6859mr1522404qtc.74.1651226495194; Fri, 29
Apr 2022 03:01: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, 29 Apr 2022 03:01:34 -0700 (PDT)
In-Reply-To: <t4g66o$otp$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:458b:c4e6:12e7:db5d;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:458b:c4e6:12e7:db5d
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk> <t48s6g$4ir$1@dont-email.me>
<87v8uvq4bv.fsf@bsb.me.uk> <t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk> <t4di33$48o$1@dont-email.me>
<871qxhmtjo.fsf@bsb.me.uk> <20220428134915.360@kylheku.com> <t4g66o$otp$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a7dacaa3-157a-4fbe-84e2-c2e006f34afdn@googlegroups.com>
Subject: Re: operator precedence
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Fri, 29 Apr 2022 10:01:35 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 73
 by: Malcolm McLean - Fri, 29 Apr 2022 10:01 UTC

On Friday, 29 April 2022 at 09:04:53 UTC+1, David Brown wrote:
> On 28/04/2022 22:51, Kaz Kylheku wrote:
> > On 2022-04-28, Ben <ben.u...@bsb.me.uk> wrote:
> >> David Brown <david...@hesbynett.no> writes:
> >>
> >>> On 27/04/2022 20:43, Ben wrote:
> >>>> David Brown <david...@hesbynett.no> writes:
> >>>>
> >>>>> You don't need parenthesis because in written mathematics, size of
> >>>>> spacing /is/ significant.
> >>>> Is it? Where can I find out about this?
> >>>>
> >>>
> >>> I mean the way you space things in how you write mathematics gives
> >>> additional information, in a way that cannot be done in a programming
> >>> language.
> >>>
> >>> If you see mathematics written :
> >>>
> >>> 10 × 2+3
> >>>
> >>> you'll interpret it differently from :
> >>>
> >>> 10×2 + 3
> >>
> >> Where does this come from?
> >
> > Human error; some people will make the mistake some of the time
> > due to following visual clues over formal syntax, mistaking
> > closer spacing for tighter binding.
> >
> > It't the same as:
> >
> > char* p, q; // oops, q is of type char, not char *.
> >
> >
> Yes.
>
> Spacing influences how people read things - it is significant to people.
> It does not affect how the compiler sees things (once you have the
> bare minimum for the syntax, of course). So IMHO using spacing as an
> extra clue to intent is useful in written mathematics, but can be
> directly counter-productive in programming - it is akin to using
> comments to say something that could be better expressed in code. Of
> course you should still use spacing to make things as clear as you
> reasonably can (and thus write "char *p, q;" - though it is usually much
> better to write them separately as "char *p; char q;"). But it is a
> mistake to use human-only indicators of intent when you can use
> something that is interpreted equally by humans and the compiler.
>
You can't have it both ways. Either you advise using spacing to help
indicate intent, or you don't.
In fact I would advise doing so.

image[y*width + x] = col;

is arguably a bit easier to read because it is more obvious that the width
associates with the y.
Of course the language itself won't treat whitespace as significant, and
that's also a wise decision - we don't want to change the long-established
mathematical conventions.
When parentheses are not strictly necessary, but it's not obvious what the
precedence is, as in

rack << Nbits + 1;

You could either using spacing or parentheses to give an extra cue. I would
advise parentheses to make it absolutely unambiguous, however remembering
the rule of three for nesting.

Re: operator precedence

<t4gnla$1e4$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Fri, 29 Apr 2022 15:02:34 +0200
Organization: A noiseless patient Spider
Lines: 114
Message-ID: <t4gnla$1e4$1@dont-email.me>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk>
<t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk>
<t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk>
<t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk>
<20220428134915.360@kylheku.com> <t4g66o$otp$1@dont-email.me>
<a7dacaa3-157a-4fbe-84e2-c2e006f34afdn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 29 Apr 2022 13:02:35 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="72344bf05fd471255637471cda595b07";
logging-data="1476"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19HwkyOPuOEbOam3fRuhVAdScvrEQiA2ms="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Cancel-Lock: sha1:c3xM4NLKAhMY/uh2o0LKBuPO02w=
In-Reply-To: <a7dacaa3-157a-4fbe-84e2-c2e006f34afdn@googlegroups.com>
Content-Language: en-GB
 by: David Brown - Fri, 29 Apr 2022 13:02 UTC

On 29/04/2022 12:01, Malcolm McLean wrote:
> On Friday, 29 April 2022 at 09:04:53 UTC+1, David Brown wrote:
>> On 28/04/2022 22:51, Kaz Kylheku wrote:
>>> On 2022-04-28, Ben <ben.u...@bsb.me.uk> wrote:
>>>> David Brown <david...@hesbynett.no> writes:
>>>>
>>>>> On 27/04/2022 20:43, Ben wrote:
>>>>>> David Brown <david...@hesbynett.no> writes:
>>>>>>
>>>>>>> You don't need parenthesis because in written mathematics, size of
>>>>>>> spacing /is/ significant.
>>>>>> Is it? Where can I find out about this?
>>>>>>
>>>>>
>>>>> I mean the way you space things in how you write mathematics gives
>>>>> additional information, in a way that cannot be done in a programming
>>>>> language.
>>>>>
>>>>> If you see mathematics written :
>>>>>
>>>>> 10 × 2+3
>>>>>
>>>>> you'll interpret it differently from :
>>>>>
>>>>> 10×2 + 3
>>>>
>>>> Where does this come from?
>>>
>>> Human error; some people will make the mistake some of the time
>>> due to following visual clues over formal syntax, mistaking
>>> closer spacing for tighter binding.
>>>
>>> It't the same as:
>>>
>>> char* p, q; // oops, q is of type char, not char *.
>>>
>>>
>> Yes.
>>
>> Spacing influences how people read things - it is significant to people.
>> It does not affect how the compiler sees things (once you have the
>> bare minimum for the syntax, of course). So IMHO using spacing as an
>> extra clue to intent is useful in written mathematics, but can be
>> directly counter-productive in programming - it is akin to using
>> comments to say something that could be better expressed in code. Of
>> course you should still use spacing to make things as clear as you
>> reasonably can (and thus write "char *p, q;" - though it is usually much
>> better to write them separately as "char *p; char q;"). But it is a
>> mistake to use human-only indicators of intent when you can use
>> something that is interpreted equally by humans and the compiler.
>>
> You can't have it both ways.

Sure I can.

> Either you advise using spacing to help
> indicate intent, or you don't.

I don't advise using spacing to influence the way some people might
interpret the code. But I /do/ advise using spacing to make it faster
and easier to read.

> In fact I would advise doing so.
>
> image[y*width + x] = col;
>
> is arguably a bit easier to read because it is more obvious that the width
> associates with the y.

It is, arguably - some might prefer that spacing, others might prefer
space around the multiply as well. Either is perfectly reasonable.

> Of course the language itself won't treat whitespace as significant, and
> that's also a wise decision - we don't want to change the long-established
> mathematical conventions.
> When parentheses are not strictly necessary, but it's not obvious what the
> precedence is, as in
>
> rack << Nbits + 1;
>
> You could either using spacing or parentheses to give an extra cue. I would
> advise parentheses to make it absolutely unambiguous, however remembering
> the rule of three for nesting.

If you feel that such expressions are hard to interpret for at least
some people, requiring significant thought, or even checking with
language references, then something needs to be done to improve the
expression. (I personally think it needs improvement as it could be
misunderstood, but not everyone agrees with that.)

My argument is that spacing is /not/ a good idea as a way to make it
easier to understand in cases like this. That would still leave doubt
in the mind of someone who is unsure of the meaning of the expression -
they might be clearer about what the writer intended, but not clearer
about whether the code actually does what the writer intended. It is no
better than a comment - and we all know that comments and code do not
always match up.

So my preference - like yours - is to have parentheses here. Then no
one is in any doubt, and reading and understanding is instantaneous and
effortless.

I am not a fan of your term "the rule of three for nesting". You make
it look like it is some kind of universal and established rule giving an
absolute boundary between comprehensible expressions and
incomprehensible expressions, when in fact it is your own personal
opinion that is not widely shared, and is at best a vague guideline.

I think most people, except perhaps Lisp programmers, will agree that
too many nested parentheses makes an expression harder to follow. But
exactly /how/ many varies according to the expression. There can be
times when four or more layers of nesting is still clear, and times when
only a couple of nested layers is unreadable.

Re: operator precedence

<t4gts3$l6l$1@dont-email.me>

  copy mid

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

  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, 29 Apr 2022 10:48:34 -0400
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <t4gts3$l6l$1@dont-email.me>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk>
<t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk>
<t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk>
<t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk>
<20220428134915.360@kylheku.com> <t4g66o$otp$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 29 Apr 2022 14:48:35 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4fa2dfc3562d06d3e68d13cdf2a9a185";
logging-data="21717"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+l81XIi8/gweleJpddsvG037CkpUfXUCU="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.8.1
Cancel-Lock: sha1:x6dTs41iQgZOw3hKndNip9aAj2A=
In-Reply-To: <t4g66o$otp$1@dont-email.me>
Content-Language: en-US
 by: James Kuyper - Fri, 29 Apr 2022 14:48 UTC

On 4/29/22 04:04, David Brown wrote:
....
> Spacing influences how people read things - it is significant to people.
> It does not affect how the compiler sees things (once you have the
> bare minimum for the syntax, of course).

The fact that it does not affect how the compiler sees things is due
entirely to how the C language was designed. During translation phase 3,
"Whether each nonempty sequence of white-space characters other than
new-line is retained or replaced by one space character is
implementation-defined." new-line characters remain significant only for
the role they play during pre-processing in translation phase 4.
Starting with translation phase , "White-space characters separating
tokens are no longer significant."

But it doesn't have to be that way. I first learned to program in
Fortran I (sic!), where it mattered a great deal where you placed things
on each punched card. I gather that there are modern languages where
indentation is very important. Then, of course, there's the Whitespace
language
<https://en.wikipedia.org/wiki/Whitespace_(programming_language)> :-}

I think you can make a good case that having the spacing of code matter
is a bad idea (and few things make that clearer than the Whitespace
language). But it's not inherently the case that is doesn't matter.

Re: operator precedence

<t4h082$b9n$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: operator precedence
Date: Fri, 29 Apr 2022 17:29:05 +0200
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <t4h082$b9n$1@dont-email.me>
References: <thought-20220408125437@ram.dialup.fu-berlin.de>
<t2v61c$ej9$1@gioia.aioe.org> <86v8ux58zx.fsf@linuxsc.com>
<t46qkv$ull$1@dont-email.me> <87ee1kudbm.fsf@bsb.me.uk>
<t48s6g$4ir$1@dont-email.me> <87v8uvq4bv.fsf@bsb.me.uk>
<t49gk8$lkd$1@dont-email.me> <t4a5ko$1n6o4$1@news.mixmin.net>
<t4aqeh$4d6$1@dont-email.me> <87y1zqmkol.fsf@bsb.me.uk>
<t4di33$48o$1@dont-email.me> <871qxhmtjo.fsf@bsb.me.uk>
<20220428134915.360@kylheku.com> <t4g66o$otp$1@dont-email.me>
<t4gts3$l6l$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 29 Apr 2022 15:29:06 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="72344bf05fd471255637471cda595b07";
logging-data="11575"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0NDiveSm76lwWT+7VnDbKkxtB+1D+EBg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Cancel-Lock: sha1:EIylIcKNexhj2I6sBO0RQgAjsD4=
In-Reply-To: <t4gts3$l6l$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Fri, 29 Apr 2022 15:29 UTC

On 29/04/2022 16:48, James Kuyper wrote:
> On 4/29/22 04:04, David Brown wrote:
> ...
>> Spacing influences how people read things - it is significant to people.
>> It does not affect how the compiler sees things (once you have the
>> bare minimum for the syntax, of course).
>
> The fact that it does not affect how the compiler sees things is due
> entirely to how the C language was designed. During translation phase 3,
> "Whether each nonempty sequence of white-space characters other than
> new-line is retained or replaced by one space character is
> implementation-defined." new-line characters remain significant only for
> the role they play during pre-processing in translation phase 4.
> Starting with translation phase , "White-space characters separating
> tokens are no longer significant."
>
> But it doesn't have to be that way. I first learned to program in
> Fortran I (sic!), where it mattered a great deal where you placed things
> on each punched card. I gather that there are modern languages where
> indentation is very important. Then, of course, there's the Whitespace
> language
> <https://en.wikipedia.org/wiki/Whitespace_(programming_language)> :-}
>

Such languages exist to remind us not to generalise too much!

> I think you can make a good case that having the spacing of code matter
> is a bad idea (and few things make that clearer than the Whitespace
> language). But it's not inherently the case that is doesn't matter.

Certainly whitespace is significant in some languages, just not in C
(except for newlines in preprocessing). It is relevant in Python, to
pick a common modern example. But even in those languages it is mostly
not significant within expressions - to the compiler, "1<<n + 2" is the
same as "1 << n+2".

Pages:1234
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor