Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

1.79 x 10^12 furlongs per fortnight -- it's not just a good idea, it's the law!


devel / comp.lang.c / Re: How About Disallowing Assignments In Expressions?

SubjectAuthor
* How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
+* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
|`* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| `- Re: How About Disallowing Assignments In Expressions?Tim Rentsch
+- Re: How About Disallowing Assignments In Expressions?Kaz Kylheku
+* Re: How About Disallowing Assignments In Expressions?David Brown
|+* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
||+* Re: How About Disallowing Assignments In Expressions?Richard Harnden
|||`* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
||| `* Re: How About Disallowing Assignments In Expressions?Richard Harnden
|||  `* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
|||   `* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
|||    `* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
|||     `- Re: How About Disallowing Assignments In Expressions?Malcolm McLean
||`* Re: How About Disallowing Assignments In Expressions?David Brown
|| +* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
|| |`- Re: How About Disallowing Assignments In Expressions?David Brown
|| `- Re: How About Disallowing Assignments In Expressions?Janis Papanagnou
|+- Re: How About Disallowing Assignments In Expressions?Kaz Kylheku
|`* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| +* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
| |+- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| |`* Re: How About Disallowing Assignments In Expressions?bart
| | +* Re: How About Disallowing Assignments In Expressions?fir
| | |`- Re: How About Disallowing Assignments In Expressions?fir
| | `* Re: How About Disallowing Assignments In Expressions?fir
| |  `* Re: How About Disallowing Assignments In Expressions?fir
| |   +- Re: How About Disallowing Assignments In Expressions?fir
| |   `- Re: How About Disallowing Assignments In Expressions?fir
| +* Re: How About Disallowing Assignments In Expressions?Kaz Kylheku
| |+- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| |`* Re: How About Disallowing Assignments In Expressions?bart
| | +- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | `- Re: How About Disallowing Assignments In Expressions?Kaz Kylheku
| +- Re: How About Disallowing Assignments In Expressions?David Brown
| +* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| |+- Re: How About Disallowing Assignments In Expressions?fir
| |`* Re: How About Disallowing Assignments In Expressions?Kaz Kylheku
| | `* Re: How About Disallowing Assignments In Expressions?dave thompson 2
| |  +* Re: How About Disallowing Assignments In Expressions?Janis Papanagnou
| |  |`- Re: How About Disallowing Assignments In Expressions?bart
| |  `- Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| +* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| |+* Re: How About Disallowing Assignments In Expressions?Kaz Kylheku
| ||`* Re: How About Disallowing Assignments In Expressions?David Brown
| || `- Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| |+* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| ||`* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| || `* Re: How About Disallowing Assignments In Expressions?David Brown
| ||  +* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| ||  |`- Re: How About Disallowing Assignments In Expressions?David Brown
| ||  `- Re: How About Disallowing Assignments In Expressions?Janis Papanagnou
| |`* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
| | +* Re: How About Disallowing Assignments In Expressions?David Brown
| | |+* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
| | ||+- Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
| | ||+* Re: How About Disallowing Assignments In Expressions?bart
| | |||`- Re: How About Disallowing Assignments In Expressions?David Brown
| | ||+- Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | ||`- Re: How About Disallowing Assignments In Expressions?David Brown
| | |`* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | | `* Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
| | |  +* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |`* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  | `* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |  `* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   +* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |   |`* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   | `* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |   |  `* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |   +* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |   |`* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |   |   | `* Re: How About Disallowing Assignments In Expressions?bart
| | |  |   |   |  `* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |   |   |   +* Re: How About Disallowing Assignments In Expressions?bart
| | |  |   |   |   |`* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |   |   |   | `- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |   |   `* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |   |    `- Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |   |   `* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |   |    +- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |    `* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |   |     `* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |   |      +* Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |      |`* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |   |      | +- Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
| | |  |   |      | `- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| | |  |   |      `- Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |   `* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
| | |  |    `* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |     +* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
| | |  |     |`* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |     | `* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
| | |  |     |  `* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |     |   `* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
| | |  |     |    `* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |     |     +* Re: How About Disallowing Assignments In Expressions?Malcolm McLean
| | |  |     |     |`- Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |     |     `* Re: How About Disallowing Assignments In Expressions?bart
| | |  |     |      +- Re: How About Disallowing Assignments In Expressions?Ben Bacarisse
| | |  |     |      `* Re: How About Disallowing Assignments In Expressions?David Brown
| | |  |     +* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | |  |     `* Re: How About Disallowing Assignments In Expressions?Janis Papanagnou
| | |  `* Re: How About Disallowing Assignments In Expressions?David Brown
| | +* Re: How About Disallowing Assignments In Expressions?Lawrence D'Oliveiro
| | `- Re: How About Disallowing Assignments In Expressions?Keith Thompson
| +- Re: How About Disallowing Assignments In Expressions?Janis Papanagnou
| `* Re: How About Disallowing Assignments In Expressions?Michael S
+* Re: How About Disallowing Assignments In Expressions?bart
+* Re: How About Disallowing Assignments In Expressions?Blue-Maned_Hawk
+- Re: How About Disallowing Assignments In Expressions?Richard Kettlewell
`* Re: How About Disallowing Assignments In Expressions?Thiago Adams

Pages:123456789101112131415161718192021
Re: [OT] was Re: How About Disallowing Assignments In Expressions?

<ur41eg$2v8o4$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: [OT] was Re: How About Disallowing Assignments In Expressions?
Date: Wed, 21 Feb 2024 00:24:32 -0500
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <ur41eg$2v8o4$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com>
<uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad>
<86wmr6z0zg.fsf@linuxsc.com> <uql32m$3apfo$1@dont-email.me>
<uql4lr$3avsv$1@dont-email.me> <uqr2cn$ilis$1@dont-email.me>
<uqr5t0$jcff$1@dont-email.me> <uqrlpo$mhj5$1@dont-email.me>
<uqrqml$n43b$7@dont-email.me> <uqt57b$16rno$1@dont-email.me>
<uqth9q$1cn02$1@dont-email.me> <87ttm5ieqp.fsf@bsb.me.uk>
<uqu2ia$1g7ff$1@dont-email.me>
<C1GdneKfeajoBk_4nZ2dnZfqn_adnZ2d@brightview.co.uk>
<uque87$1i55a$2@dont-email.me> <uqv1nm$1ovej$1@dont-email.me>
<uqvo4k$1tfor$1@dont-email.me> <uqvrjm$1u9qq$2@dont-email.me>
<uqvtg6$1uo1n$1@dont-email.me> <ur01nj$1vmpt$1@dont-email.me>
<ur0372$200ou$1@dont-email.me> <ur1e9d$2bqel$2@dont-email.me>
<ur1tpj$2emq1$2@dont-email.me> <ur2pum$2kfm3$1@dont-email.me>
<ur2qtj$2k2bi$2@dont-email.me> <20240220105111.651@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 21 Feb 2024 05:24:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f679441fdf6cd96c59400d664f91e949";
logging-data="3121924"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XzFduy407pYXNW6ebiizjGzl+xRGY9ro="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:riMnZa3VA33fPxyuyY/xikYgY8g=
In-Reply-To: <20240220105111.651@kylheku.com>
Content-Language: en-US
 by: James Kuyper - Wed, 21 Feb 2024 05:24 UTC

On 2/20/24 13:51, Kaz Kylheku wrote:
> On 2024-02-20, Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>> On Tue, 20 Feb 2024 18:10:30 +0000, Richard Harnden wrote:
....
>>> Why wouldn't light be travelling in a straight line?
>>
>> Refraction, either by a change in medium or gravity (or some other force).
>
> Pockets or layers of air at different temperature? That would never
> affect a view of the horizon, right?

Why not? Air density drops rapidly with altitude, causing refraction as
light travels through the air. The net result is that, if the air were
perfectly clear and the Earth perfectly spherical, you could see
significantly more of Earth from any given position than you would
expect if you didn't take refraction into effect. You can still see the
setting Sun for many minutes after you might otherwise expect it to
disappear below the horizon, because it's light in bent by refraction
(and, of course, see the rising Sun several minutes earlier for the same
reason).

Re: How About Disallowing Assignments In Expressions?

<ur420a$2v5r5$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Wed, 21 Feb 2024 00:34:02 -0500
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <ur420a$2v5r5$2@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com>
<uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad>
<86wmr6z0zg.fsf@linuxsc.com> <uql32m$3apfo$1@dont-email.me>
<uql4lr$3avsv$1@dont-email.me> <uqr2cn$ilis$1@dont-email.me>
<uqr5t0$jcff$1@dont-email.me> <uqrlpo$mhj5$1@dont-email.me>
<uqrqml$n43b$7@dont-email.me> <uqt57b$16rno$1@dont-email.me>
<uqth9q$1cn02$1@dont-email.me> <87ttm5ieqp.fsf@bsb.me.uk>
<uqu2ia$1g7ff$1@dont-email.me>
<C1GdneKfeajoBk_4nZ2dnZfqn_adnZ2d@brightview.co.uk>
<rKWcnUA48fOzN074nZ2dnZfqn_idnZ2d@brightview.co.uk>
<87v86kdmor.fsf@bsb.me.uk> <ur0vnu$252u4$12@dont-email.me>
<ur1o2j$2da8e$2@dont-email.me> <ur3bi0$2nf9c$11@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 21 Feb 2024 05:34:02 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f679441fdf6cd96c59400d664f91e949";
logging-data="3118949"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jAu7O9mLlb8dmA1mO3rtiwoGlYpn6tsU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:NV3yrfg02GBwSdXvp5DRIel2H+U=
Content-Language: en-US
In-Reply-To: <ur3bi0$2nf9c$11@dont-email.me>
 by: James Kuyper - Wed, 21 Feb 2024 05:34 UTC

On 2/20/24 18:10, Lawrence D'Oliveiro wrote:
> On Tue, 20 Feb 2024 03:32:19 -0500, James Kuyper wrote:
>
>> On 2/19/24 20:37, Lawrence D'Oliveiro wrote:
>>> On Tue, 20 Feb 2024 00:05:56 +0000, Ben Bacarisse wrote:
>>>
>>>> Now, can we find a good mnemonic for C's operator precedence levels?
>>>
>>> “RTFM”.
>>
>> The standard doesn't describe operator precedence levels. It provides
>> grammar rules, and precedence must be inferred from the grammar. I've
>> found that it is not widely understood how to infer precedence from the
>> grammar.
>
> Wasn’t BNF covered in one of your undergraduate CS courses?

No. I'm mostly self-taught in computer programming. My degree was in
Physics, not CS. I took a few CS courses, but not many. I had planned to
be a scientist who could write his own data analysis and simulation
programs. I ended up with a career writing scientific computer programs
rather than coming up with new scientific theories of my own. I was
always very good at understanding scientific theories, but I lacked the
imagination needed to come up with new ones.

However, despite lacking a CS background, as I've already said, I have
no trouble figuring out precedence levels by examining the grammar. My
point was that I've talked with many people who found it less obvious
than you or I do.

Re: How About Disallowing Assignments In Expressions?

<ur44nk$2voik$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Wed, 21 Feb 2024 06:20:36 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <ur44nk$2voik$2@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com>
<uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad>
<86wmr6z0zg.fsf@linuxsc.com> <uql32m$3apfo$1@dont-email.me>
<uql4lr$3avsv$1@dont-email.me> <uqr2cn$ilis$1@dont-email.me>
<uqr5t0$jcff$1@dont-email.me> <uqrlpo$mhj5$1@dont-email.me>
<uqrqml$n43b$7@dont-email.me> <uqt57b$16rno$1@dont-email.me>
<uqth9q$1cn02$1@dont-email.me> <87ttm5ieqp.fsf@bsb.me.uk>
<uqu2ia$1g7ff$1@dont-email.me>
<C1GdneKfeajoBk_4nZ2dnZfqn_adnZ2d@brightview.co.uk>
<rKWcnUA48fOzN074nZ2dnZfqn_idnZ2d@brightview.co.uk>
<87v86kdmor.fsf@bsb.me.uk> <ur0vnu$252u4$12@dont-email.me>
<ur1o2j$2da8e$2@dont-email.me> <ur3bi0$2nf9c$11@dont-email.me>
<ur420a$2v5r5$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 21 Feb 2024 06:20:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="01b911325e9528685287d2bc56fa86ff";
logging-data="3138132"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vAfDtIcKcOms1ddADtAQM"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:VjvkrQlVaXsOZHkVkRKEawk8IBY=
 by: Lawrence D'Oliv - Wed, 21 Feb 2024 06:20 UTC

On Wed, 21 Feb 2024 00:34:02 -0500, James Kuyper wrote:

> My point was that I've talked with many people who found it less obvious
> than you or I do.

Did they know how to read a BNF grammar?

Re: How About Disallowing Assignments In Expressions?

<ur44pb$2voik$3@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Wed, 21 Feb 2024 06:21:31 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <ur44pb$2voik$3@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uqbrjo$16jcf$6@dont-email.me>
<uqg3m0$258lu$5@dont-email.me> <uqgpd1$29928$3@dont-email.me>
<87il2s9fdj.fsf@nosuchdomain.example.com> <uqj95e$2qhb1$1@dont-email.me>
<sEazN.324764$Wp_8.34532@fx17.iad> <86wmr6z0zg.fsf@linuxsc.com>
<uql32m$3apfo$1@dont-email.me> <uql4lr$3avsv$1@dont-email.me>
<uqr2cn$ilis$1@dont-email.me> <uqr5t0$jcff$1@dont-email.me>
<uqrlpo$mhj5$1@dont-email.me> <uqrqml$n43b$7@dont-email.me>
<uqt57b$16rno$1@dont-email.me> <uqth9q$1cn02$1@dont-email.me>
<87ttm5ieqp.fsf@bsb.me.uk> <uqu2ia$1g7ff$1@dont-email.me>
<C1GdneKfeajoBk_4nZ2dnZfqn_adnZ2d@brightview.co.uk>
<rKWcnUA48fOzN074nZ2dnZfqn_idnZ2d@brightview.co.uk>
<87v86kdmor.fsf@bsb.me.uk> <86v86jx4fv.fsf@linuxsc.com>
<ur2mvv$2jsqk$1@dont-email.me> <ur3b3n$2nf9c$10@dont-email.me>
<ur3gci$2osoh$1@dont-email.me> <ur3h30$2ovd2$1@dont-email.me>
<ur3lan$2pm1h$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 21 Feb 2024 06:21:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="01b911325e9528685287d2bc56fa86ff";
logging-data="3138132"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eFpagX+vAwy96+DW+yK5X"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:a62DZBrLw5JB8Tq8ftmYtQQPON0=
 by: Lawrence D'Oliv - Wed, 21 Feb 2024 06:21 UTC

On Wed, 21 Feb 2024 01:57:42 +0000, bart wrote:

> On 21/02/2024 00:45, Lawrence D'Oliveiro wrote:
>
>> On Wed, 21 Feb 2024 00:33:21 +0000, bart wrote:
>>
>>> On 20/02/2024 23:03, Lawrence D'Oliveiro wrote:
>>>>
>>>> final PointF ThisMouse =
>>>> ThisMouse1 != null ?
>>>> ThisMouse2 != null ?
>>>> new PointF
>>>> (
>>>> (ThisMouse1.x + ThisMouse2.x) / 2.0f,
>>>> (ThisMouse1.y + ThisMouse2.y) / 2.0f
>>>> )
>>>> :
>>>> ThisMouse1
>>>> :
>>>> ThisMouse2;
>>>
>>> But you wouldn't write that would you?
>>
>> I did. That is from actual, working code.
>
> So why didn't you use 'if' and 'else'?

Then it couldn’t have been “final”.

Re: [OT] was Re: How About Disallowing Assignments In Expressions?

<ur49fi$30fpu$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: [OT] was Re: How About Disallowing Assignments In Expressions?
Date: Wed, 21 Feb 2024 08:41:38 +0100
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <ur49fi$30fpu$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uqau5o$11nm8$1@dont-email.me>
<uqauo4$11vps$1@dont-email.me> <uqbrjo$16jcf$6@dont-email.me>
<uqg3m0$258lu$5@dont-email.me> <uqgpd1$29928$3@dont-email.me>
<87il2s9fdj.fsf@nosuchdomain.example.com> <uqj95e$2qhb1$1@dont-email.me>
<sEazN.324764$Wp_8.34532@fx17.iad> <86wmr6z0zg.fsf@linuxsc.com>
<uql32m$3apfo$1@dont-email.me> <uql4lr$3avsv$1@dont-email.me>
<uqr2cn$ilis$1@dont-email.me> <uqr5t0$jcff$1@dont-email.me>
<uqrlpo$mhj5$1@dont-email.me> <uqrqml$n43b$7@dont-email.me>
<uqt57b$16rno$1@dont-email.me> <uqth9q$1cn02$1@dont-email.me>
<87ttm5ieqp.fsf@bsb.me.uk> <uqu2ia$1g7ff$1@dont-email.me>
<C1GdneKfeajoBk_4nZ2dnZfqn_adnZ2d@brightview.co.uk>
<uque87$1i55a$2@dont-email.me> <uqv1nm$1ovej$1@dont-email.me>
<uqvo4k$1tfor$1@dont-email.me> <uqvrjm$1u9qq$2@dont-email.me>
<uqvtg6$1uo1n$1@dont-email.me> <ur01nj$1vmpt$1@dont-email.me>
<ur0372$200ou$1@dont-email.me> <ur1e9d$2bqel$2@dont-email.me>
<ur1m77$2d9lc$1@dont-email.me> <ur39jb$2nf9c$6@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 21 Feb 2024 07:41:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b886f9d7b6fab19f8fe94947c67334bd";
logging-data="3161918"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6uGPgX8CzlpD7jYxiCY54NqqQKX8r4e0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:xH5r+EzwJiT5JOJdudgxOXpEGMc=
In-Reply-To: <ur39jb$2nf9c$6@dont-email.me>
Content-Language: en-GB
 by: David Brown - Wed, 21 Feb 2024 07:41 UTC

On 20/02/2024 23:37, Lawrence D'Oliveiro wrote:
> On Tue, 20 Feb 2024 09:00:39 +0100, David Brown wrote:
>
>> No, you'd still have a horizon if you were standing on an infinite plane
>
> On an infinite plane, objects moving away from you on the plane would
> never disappear over any horizon.

Correct, but you would still see the line of the horizon between the
"land" and the "sky". So it would look the same, but it would not act
the same as objects moved into the distance.

So I guess in your previous post you meant that the existence of a
horizon that things disappear over is proof of a round Earth? (Snipping
posts is helpful - snipping too much context is not.)

If the air were perfectly clear, and people's long-distance eyesight
were perfect, then what you say would be true. But objects "disappear"
with distance even if they don't go over the horizon - it is very
difficult with the naked eye to realise there is a fundamental
difference between a ship disappearing over the horizon, and a bird
flying off out of sight. It was not until people starting building
things like the lighthouse at Alexandria that you could really be sure
of the effect of disappearing over the horizon.

Re: [OT] was Re: How About Disallowing Assignments In Expressions?

<ur4a3s$30fpu$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.samoylyk.net!newsfeed.xs3.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: [OT] was Re: How About Disallowing Assignments In Expressions?
Date: Wed, 21 Feb 2024 08:52:28 +0100
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <ur4a3s$30fpu$2@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uqbrjo$16jcf$6@dont-email.me>
<uqg3m0$258lu$5@dont-email.me> <uqgpd1$29928$3@dont-email.me>
<87il2s9fdj.fsf@nosuchdomain.example.com> <uqj95e$2qhb1$1@dont-email.me>
<sEazN.324764$Wp_8.34532@fx17.iad> <86wmr6z0zg.fsf@linuxsc.com>
<uql32m$3apfo$1@dont-email.me> <uql4lr$3avsv$1@dont-email.me>
<uqr2cn$ilis$1@dont-email.me> <uqr5t0$jcff$1@dont-email.me>
<uqrlpo$mhj5$1@dont-email.me> <uqrqml$n43b$7@dont-email.me>
<uqt57b$16rno$1@dont-email.me> <uqth9q$1cn02$1@dont-email.me>
<87ttm5ieqp.fsf@bsb.me.uk> <uqu2ia$1g7ff$1@dont-email.me>
<C1GdneKfeajoBk_4nZ2dnZfqn_adnZ2d@brightview.co.uk>
<uque87$1i55a$2@dont-email.me> <uqv1nm$1ovej$1@dont-email.me>
<uqvo4k$1tfor$1@dont-email.me> <uqvrjm$1u9qq$2@dont-email.me>
<uqvtg6$1uo1n$1@dont-email.me> <ur01nj$1vmpt$1@dont-email.me>
<ur0372$200ou$1@dont-email.me> <ur1e9d$2bqel$2@dont-email.me>
<ur1tpj$2emq1$2@dont-email.me> <ur2pum$2kfm3$1@dont-email.me>
<ur2qtj$2k2bi$2@dont-email.me> <ur2r4v$2kfm3$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 21 Feb 2024 07:52:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b886f9d7b6fab19f8fe94947c67334bd";
logging-data="3161918"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fFW8XehSkgkbouwIdLlQqvdTo4gWqY8U="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:xRjDCjdPBpRt1isoFbotI0CfTyE=
In-Reply-To: <ur2r4v$2kfm3$3@dont-email.me>
Content-Language: en-GB
 by: David Brown - Wed, 21 Feb 2024 07:52 UTC

On 20/02/2024 19:30, Richard Harnden wrote:
> On 20/02/2024 18:26, Lew Pitcher wrote:
>> On Tue, 20 Feb 2024 18:10:30 +0000, Richard Harnden wrote:
>>
>>> On 20/02/2024 10:09, Malcolm McLean wrote:
>>>> On 20/02/2024 05:45, Lawrence D'Oliveiro wrote:
>>>>> On Mon, 19 Feb 2024 18:30:08 +0100, Janis Papanagnou wrote:
>>>>>
>>>>>> (And some more people, like Pythagoras and Platon, assumed a
>>>>>> spherical
>>>>>> earth ...
>>>>>
>>>>> Isn’t the simple fact of the existence of the horizon sufficient
>>>>> evidence
>>>>> that the Earth is round?
>>>>
>>>> The horizon is curved, which boys sometimes advanced as proof that the
>>>> Earth must indeed be round. (The geography teacher taught that).
>>>> But, as
>>>> Selby pointed out, that only holds if we assume that the light is
>>>> travelling in straight lines.
>>>>
>>>
>>> Why wouldn't light be travelling in a straight line?
>>
>> Refraction, either by a change in medium or gravity (or some other
>> force).
>> That's the stuff lenses (physical and gravitational) are made of :-)
>>
>>
>
> The Earth is not a black-hole, and the atmostphere is not that thick.
>

Black holes don't bend light any more than any other object with the
same mass. It's just that you can get closer to a black hole without
being inside it. (And gravity does not "bend" light - mass bends
space-time, and the light goes in a straight line in the bent space-time.)

And the atmosphere /is/ that thick. The refractive index of air is
usually negligible, but the earth's atmosphere is big enough that we see
the sun half a degree out at sunset and sunrise.

But refraction needs changes in the density or composition of the air -
and when you are talking about measurements close to the earth's
surface, the refractive index does not change much so there is usually
very little refraction. (How thick the atmosphere is has nothing to do
with it - only differences matter for refraction.)

Re: How About Disallowing Assignments In Expressions?

<ur4be4$30tpu$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.samoylyk.net!nyheter.lysator.liu.se!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Wed, 21 Feb 2024 09:14:59 +0100
Organization: A noiseless patient Spider
Lines: 103
Message-ID: <ur4be4$30tpu$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uqbrjo$16jcf$6@dont-email.me>
<uqg3m0$258lu$5@dont-email.me> <uqgpd1$29928$3@dont-email.me>
<87il2s9fdj.fsf@nosuchdomain.example.com> <uqj95e$2qhb1$1@dont-email.me>
<sEazN.324764$Wp_8.34532@fx17.iad> <86wmr6z0zg.fsf@linuxsc.com>
<uql32m$3apfo$1@dont-email.me> <uql4lr$3avsv$1@dont-email.me>
<uqr2cn$ilis$1@dont-email.me> <uqr5t0$jcff$1@dont-email.me>
<uqrlpo$mhj5$1@dont-email.me> <uqrqml$n43b$7@dont-email.me>
<uqt57b$16rno$1@dont-email.me> <uqth9q$1cn02$1@dont-email.me>
<87ttm5ieqp.fsf@bsb.me.uk> <uqu2ia$1g7ff$1@dont-email.me>
<C1GdneKfeajoBk_4nZ2dnZfqn_adnZ2d@brightview.co.uk>
<rKWcnUA48fOzN074nZ2dnZfqn_idnZ2d@brightview.co.uk>
<87v86kdmor.fsf@bsb.me.uk> <86v86jx4fv.fsf@linuxsc.com>
<ur2mvv$2jsqk$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 21 Feb 2024 08:15:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b886f9d7b6fab19f8fe94947c67334bd";
logging-data="3176254"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18+McEGlYT5ksYnOm7FOc8ljkMcLQ+BZPM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:s5eV/ZTDMX7pmrs/7v/U1uawRFw=
In-Reply-To: <ur2mvv$2jsqk$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Wed, 21 Feb 2024 08:14 UTC

On 20/02/2024 18:20, bart wrote:
> On 20/02/2024 02:19, Tim Rentsch wrote:
>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>
>>> [...]
>>>
>>> Now, can we find a good mnemonic for C's operator precedence levels?
>>> Extra credit if left/right associativity is also covered.
>>
>> Let me ask, which areas give people the most trouble, or where do
>> they find that they need help remembering?  My reason for asking is
>> I myself find most of C's expression syntax behaves the way I expect
>> without having to think about it, so I need relatively few memory
>> aids to feel confident in knowing the whole stack.  But what are the
>> stumbling blocks for other folks?
>
>
> I like to intuitively think of binary operators as belonging to three
> groups:
>
>   (1) Within expressions (arithmetic, but also bitwise ops)
>
>   (2) Comparisons (with one precedence level)
>
>   (3) Logical and/or (only 2 precedence levels)
>
> All (1) have higher precendence than (2), which are higher than (3). (In
> my code, groups (2) and (3) mostly occur in conditional expressions such
> as 'f (expr)'.)
>
> C mixes up some operators between (1) and (2), that's one thing.
> For example, ^ is bizarrely lower precedence than ==.
>

I agree that this is strange. I suspect it was the result of the
historical split of the logical and bitwise operators - it makes sense
to have logical operators as lower than equality, and bitwise operators
presumably stayed there after the split instead of being moved up.

> Even within the same group (1), I think of << and >> as scaling
> operators of the same rank as * and /, since they really do the same job
> (any shift can be implemented with multiple or divide by a power of two).

I agree on that too (with the caveat that signed division by powers of
two is not just a shift in C - and that's another decision that could
certainly be questioned).

>
> Yet C puts the precedence of << and >> the other side of + and -. This
> means that:
>
>    1 << 2 + 3
>
> is 1<<(2+3) or 32, not (1<<2)+3 or 7.
>

This is why some of us like to put in the "extra" parentheses :-)

> Another one is ?: as in:
>
>      a ? b ? c : d : e     // or:
>      a ? b : c ? d : e
>
> With more complex terms, it's easy to get lost. Although this one is not
> so much about precedence; I wouldn't class it as an operator all, and
> would insist on parentheses so that the boundaries of this 3-way
> construct are absolutely clear.
>
> With parentheses, I /believe/ the correct grouping that corrresponds is
> repectively:
>
>      (a ? (b ? c : d) : e)
>      (a ? b : (c ? d : e))
>
> Now I can change 'I believe' to 'I know'.
>

That is more about associativity than precedence. There is no way the
expressions could mean anything else - if the associativity were
difference, chaining like your first case would have to be a syntax
error, and for the second case it would mean the same anyway.

> Remember this is not just about working with C. People may work on
> different languages with their own rules.

Yes, I agree again. (I think this may be a record?) Again, parentheses
and splitting up expressions into parts is the way to keep sane and safe.

>
> `2 + 3 * 4` is near-universally evaluated as 14. With `1 << 2 + 3` most
> languages I managed to try on rextester.com (which supported infix
> `<<`), also gave C's result of 32.
>
> This means a lot of languages that have perpetuated C's bad choices.
>
> A few languages however did not just blindly follow C, such as Pascal,
> Go and Swift; those gave a result of 7.
>
>
>
>

Re: How About Disallowing Assignments In Expressions?

<ur4c5r$30tpu$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Wed, 21 Feb 2024 09:27:39 +0100
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <ur4c5r$30tpu$2@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uqbrjo$16jcf$6@dont-email.me>
<uqg3m0$258lu$5@dont-email.me> <uqgpd1$29928$3@dont-email.me>
<87il2s9fdj.fsf@nosuchdomain.example.com> <uqj95e$2qhb1$1@dont-email.me>
<sEazN.324764$Wp_8.34532@fx17.iad> <86wmr6z0zg.fsf@linuxsc.com>
<uql32m$3apfo$1@dont-email.me> <uql4lr$3avsv$1@dont-email.me>
<uqr2cn$ilis$1@dont-email.me> <uqr5t0$jcff$1@dont-email.me>
<uqrlpo$mhj5$1@dont-email.me> <uqrqml$n43b$7@dont-email.me>
<uqt57b$16rno$1@dont-email.me> <uqth9q$1cn02$1@dont-email.me>
<87ttm5ieqp.fsf@bsb.me.uk> <uqu2ia$1g7ff$1@dont-email.me>
<C1GdneKfeajoBk_4nZ2dnZfqn_adnZ2d@brightview.co.uk>
<rKWcnUA48fOzN074nZ2dnZfqn_idnZ2d@brightview.co.uk>
<20240219184101.37@kylheku.com> <87bk8be6ua.fsf@bsb.me.uk>
<20240220090645.275@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 21 Feb 2024 08:27:39 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b886f9d7b6fab19f8fe94947c67334bd";
logging-data="3176254"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XujGOFmWJ5lHNDmvuBRdK6B+etU80b6M="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:LDp83caOQouNSuTvT9tIdVIp5JI=
In-Reply-To: <20240220090645.275@kylheku.com>
Content-Language: en-GB
 by: David Brown - Wed, 21 Feb 2024 08:27 UTC

On 20/02/2024 18:12, Kaz Kylheku wrote:
> On 2024-02-20, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
>> Kaz Kylheku <433-929-6894@kylheku.com> writes:
>>
>>> On 2024-02-19, Mike Terry <news.dead.person.stones@darjeeling.plus.com> wrote:
>>>> In case anyone was curious...
>>>>
>>>> |
>>>> |
>>>> Cause | Armpits
>>>> |
>>>> |
>>>> --------------+--------------
>>>> |
>>>> |
>>>> Termites | Smelly
>>>> |
>>>> |
>>>
>>> I learned
>>>
>>> crazy all
>>>
>>> teachers are science
>>>
>>> from a math teacher who was Scottish. Someone in the class piped up
>>> with "all Scottish teachers are crazy", to great laughter.
>>
>> I don't think it worked! I was maybe too subtle in my last post, but
>> you have to remember something entirely arbitrary with this sort of
>> thing -- where to start and the order of going round (or otherwise
>> naming) the quadrants. All the posted examples I've see have the C and
>> S quadrants swapped over.
>
> Like a Chat AI robot, I just followed my interlocutor's example,
> and pretended it's right.
>
> For a moment, I wondered why the words are going clockwise (negative
> rotation) but didn't give it a moment's thought beyond that.
>
> Part of the value of the "all science teachers are crazy" mnemonic is
> that it starts with the first quadrant and follows the positive angle.
>
> You will not get it wrong, unless you're preloaded with a wrong example
> and don't think about it.
>
> If you think about it for a millisecond, of course sin() is positive
> over the first 180 degrees, but since cos() starts high, that
> function drops and crosses zero at 90. If you know this simple
> thing, you don't need the mnemonic.
>

I don't understand why anyone would feel the need for mnemonics here at
all. I think it is because people are often taught first that sins and
cosines are about right-angled triangles. Then they get confused and
have to unlearn things when the arguments are outside of 0° - 90°.

Think of the unit circle, and draw an angle θ from the x-axis - going
counter-clockwise, as you always do. cos θ is the x coordinate, sin θ
is the y coordinate. It's now all obvious and easy, and there is no
need for even a millisecond's thought about signs.

Re: How About Disallowing Assignments In Expressions?

<86msruw462.fsf@linuxsc.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Wed, 21 Feb 2024 01:35:33 -0800
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <86msruw462.fsf@linuxsc.com>
References: <uq3s76$28dsr$1@dont-email.me> <uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com> <uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad> <86wmr6z0zg.fsf@linuxsc.com> <uql32m$3apfo$1@dont-email.me> <uql4lr$3avsv$1@dont-email.me> <uqr2cn$ilis$1@dont-email.me> <uqr5t0$jcff$1@dont-email.me> <uqrlpo$mhj5$1@dont-email.me> <uqrqml$n43b$7@dont-email.me> <uqt57b$16rno$1@dont-email.me> <uqth9q$1cn02$1@dont-email.me> <87ttm5ieqp.fsf@bsb.me.uk> <uqu2ia$1g7ff$1@dont-email.me> <C1GdneKfeajoBk_4nZ2dnZfqn_adnZ2d@brightview.co.uk> <rKWcnUA48fOzN074nZ2dnZfqn_idnZ2d@brightview.co.uk> <87v86kdmor.fsf@bsb.me.uk> <ur1mi1$2d9lc$2@dont-email.me> <875xyje60h.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="c2d56115d1a51f86374d36f48015b9bf";
logging-data="3206051"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19aFFEVLliltf8AIRQSBECfGbYOt3QUmpA="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:KRXKdN20Z5SHFFW96eE/Q9m4cgA=
sha1:BX+ClwdPAQNhuaovtEteCyKDKP8=
 by: Tim Rentsch - Wed, 21 Feb 2024 09:35 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> [...]
>
>> On 20/02/2024 01:05, Ben Bacarisse wrote:
>>
>>> Mike Terry <news.dead.person.stones@darjeeling.plus.com> writes:
>>> [...]

>>> Your example shows why I never liked this sort of "help".
>>> Remembering where to start and what order to label the quadrants
>>> is harder (for me) than knowing how trig functions work.
>>
>> Same for me. The trick to getting the signs of sins right is to
>> think of circles, not triangles, when doing trig. Then it is all
>> completely obvious.
>>
>>> Now, can we find a good mnemonic for C's operator precedence
>>> levels? Extra credit if left/right associativity is also
>>> covered. (Few! On topic again.)

[...]

> For me, pretty much the only one I'd have to look up (though only
> in a year or two, since I've recently been reminded!) is ^ vs |.

There are different kinds of memory aids. The ones that tend to
work for me are those with some semantic content, not just rote
memorization or via some cryptic acronym. This idea is similar
to the first two paragraphs quoted above.

For the bitwise logical operators, an example of the kind of
memory aid I find helpful is as follows.

The result of an & operator can have fewer bits on than its
operands, but never more;

The result of an | operator can have more bits on than its
operands, but never fewer;

The result of an ^ operator can have either fewer bits on or
more bits on than its operands (or possibly the same number),
depending on the values of the operands.

Hence it makes sense to put ^ between & and |, and that
is indeed where it is in C's precedence hierarchy --
fewer, fewer or more, more -- & ^ |.

(Of course I expect & binds more tightly than |, as is
conventional in mathematics and hardware design, etc.)

I can't say I ever had a problem with the relative precedences of
the bitwise logical operators, but this description probably did
help cement it for me.

Re: How About Disallowing Assignments In Expressions?

<ur4lja$33692$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.chmurka.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm....@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Wed, 21 Feb 2024 11:08:26 +0000
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <ur4lja$33692$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uqbrjo$16jcf$6@dont-email.me>
<uqg3m0$258lu$5@dont-email.me> <uqgpd1$29928$3@dont-email.me>
<87il2s9fdj.fsf@nosuchdomain.example.com> <uqj95e$2qhb1$1@dont-email.me>
<sEazN.324764$Wp_8.34532@fx17.iad> <86wmr6z0zg.fsf@linuxsc.com>
<uql32m$3apfo$1@dont-email.me> <uql4lr$3avsv$1@dont-email.me>
<uqr2cn$ilis$1@dont-email.me> <uqr5t0$jcff$1@dont-email.me>
<uqrlpo$mhj5$1@dont-email.me> <uqrqml$n43b$7@dont-email.me>
<uqt57b$16rno$1@dont-email.me> <uqth9q$1cn02$1@dont-email.me>
<87ttm5ieqp.fsf@bsb.me.uk> <uqu2ia$1g7ff$1@dont-email.me>
<C1GdneKfeajoBk_4nZ2dnZfqn_adnZ2d@brightview.co.uk>
<rKWcnUA48fOzN074nZ2dnZfqn_idnZ2d@brightview.co.uk>
<20240219184101.37@kylheku.com> <87bk8be6ua.fsf@bsb.me.uk>
<20240220090645.275@kylheku.com> <ur4c5r$30tpu$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 21 Feb 2024 11:08:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="93cabd1993daa1f2219920dd41466abc";
logging-data="3250466"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ZgGuwaP+P13SnxGtEmSnvoQa51yiNJh4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:51o3ODji5AfxNJaXe5he8F9SNr0=
Content-Language: en-GB
In-Reply-To: <ur4c5r$30tpu$2@dont-email.me>
 by: Malcolm McLean - Wed, 21 Feb 2024 11:08 UTC

On 21/02/2024 08:27, David Brown wrote:
>
> I don't understand why anyone would feel the need for mnemonics here at
> all.  I think it is because people are often taught first that sins and
> cosines are about right-angled triangles.  Then they get confused and
> have to unlearn things when the arguments are outside of 0° - 90°.
>
> Think of the unit circle, and draw an angle θ from the x-axis - going
> counter-clockwise, as you always do.  cos θ is the x coordinate, sin θ
> is the y coordinate.  It's now all obvious and easy, and there is no
> need for even a millisecond's thought about signs.
>

Now I've read many Mike Terry posts here, and the last thing I would say
about him is that he strikes me as someone who doesn't know very much
abut maths. But he got it wrong. And I thought that there must be some
convention that I wasn't aware of. But in fact there wasn't. He admitted
that he simply got it wrong.

So even people who are good at maths think about it in different ways.
And they may not help everyine. But mnemonics can be extremely helpful.

--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: [OT] was Re: How About Disallowing Assignments In Expressions?

<ur4mbk$33l6r$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!nntp.comgw.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm....@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: [OT] was Re: How About Disallowing Assignments In Expressions?
Date: Wed, 21 Feb 2024 11:21:22 +0000
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <ur4mbk$33l6r$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com>
<uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad>
<86wmr6z0zg.fsf@linuxsc.com> <uql32m$3apfo$1@dont-email.me>
<uql4lr$3avsv$1@dont-email.me> <uqr2cn$ilis$1@dont-email.me>
<uqr5t0$jcff$1@dont-email.me> <uqrlpo$mhj5$1@dont-email.me>
<uqrqml$n43b$7@dont-email.me> <uqt57b$16rno$1@dont-email.me>
<uqth9q$1cn02$1@dont-email.me> <87ttm5ieqp.fsf@bsb.me.uk>
<uqu2ia$1g7ff$1@dont-email.me>
<C1GdneKfeajoBk_4nZ2dnZfqn_adnZ2d@brightview.co.uk>
<uque87$1i55a$2@dont-email.me> <uqv1nm$1ovej$1@dont-email.me>
<uqvo4k$1tfor$1@dont-email.me> <uqvrjm$1u9qq$2@dont-email.me>
<uqvtg6$1uo1n$1@dont-email.me> <ur01nj$1vmpt$1@dont-email.me>
<ur0372$200ou$1@dont-email.me> <ur1e9d$2bqel$2@dont-email.me>
<ur1tpj$2emq1$2@dont-email.me> <ur2pum$2kfm3$1@dont-email.me>
<ur40rl$2v5r5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 21 Feb 2024 11:21:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="93cabd1993daa1f2219920dd41466abc";
logging-data="3265755"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xknzst70bycJRVYAIeI/MTcOppynvO6U="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:7UihJtp0ck10h/6hJQQVFdvDkyE=
Content-Language: en-GB
In-Reply-To: <ur40rl$2v5r5$1@dont-email.me>
 by: Malcolm McLean - Wed, 21 Feb 2024 11:21 UTC

On 21/02/2024 05:14, James Kuyper wrote:
> On 2/20/24 13:10, Richard Harnden wrote:
>> On 20/02/2024 10:09, Malcolm McLean wrote:
>>> On 20/02/2024 05:45, Lawrence D'Oliveiro wrote:
>>>> On Mon, 19 Feb 2024 18:30:08 +0100, Janis Papanagnou wrote:
>>>>
>>>>> (And some more people, like Pythagoras and Platon, assumed a spherical
>>>>> earth ...
>>>>
>>>> Isn’t the simple fact of the existence of the horizon sufficient evidence
>>>> that the Earth is round?
>>>
>>> The horizon is curved, which boys sometimes advanced as proof that the
>>> Earth must indeed be round. (The geography teacher taught that). But, as
>>> Selby pointed out, that only holds if we assume that the light is
>>> travelling in straight lines.
>>>
>>
>> Why wouldn't light be travelling in a straight line?
>
> In the real world, two reasons: refraction, and gravity. However, if
> Selby were trying to teach skepticism, the important thing is not
> whether there are known reasons why light would not travel in straight
> lines. The important point is that it must be established that it does
> travel in straight lines, it cannot simply be assumed.
>
> You can't prove that light always travels in straight lines, for the
> same reason why you can't prove the truth of any other general statement
> about the real world. The most you can do is collect enough evidence to
> justify a high level of confidence in the truth of such a statement.
> In particular, it is possible to collect evidence sufficient to support
> an accurate theory about how light travels through space, including the
> effects of both refraction and gravity. Such a theory can then be used
> to show that a horizon remains inconsistent with a flat earth, even
> taking those effects into consideration.
>
> However, the end result of teaching skepticism properly should have been
> boys who were competent to explain the evidence that rules out a flat
> earth. From Malcolm's own description, none of them were able to do so,
> and that makes Selby a bad teacher.
>
Any idiot can teach the argument against a flat Earth. The hard part is
teaching people how to construct that argument, off their own bat,
without other people telling them what it is, and so that it stands up
to deep-seated misconceptions which are not without considerable
justification (historically, not that the earth is flat, but that it is
the centre of the universe).

That's what Selby was tryng to do. And he might not have been perfect at
it. But he had a pretty good go. And he was only a maths teacher. He
wasn't formally qualified to teach philosophy.
--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: [OT] was Re: How About Disallowing Assignments In Expressions?

<ur586e$38b6b$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: [OT] was Re: How About Disallowing Assignments In Expressions?
Date: Wed, 21 Feb 2024 11:25:50 -0500
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <ur586e$38b6b$2@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com>
<uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad>
<86wmr6z0zg.fsf@linuxsc.com> <uql32m$3apfo$1@dont-email.me>
<uql4lr$3avsv$1@dont-email.me> <uqr2cn$ilis$1@dont-email.me>
<uqr5t0$jcff$1@dont-email.me> <uqrlpo$mhj5$1@dont-email.me>
<uqrqml$n43b$7@dont-email.me> <uqt57b$16rno$1@dont-email.me>
<uqth9q$1cn02$1@dont-email.me> <87ttm5ieqp.fsf@bsb.me.uk>
<uqu2ia$1g7ff$1@dont-email.me>
<C1GdneKfeajoBk_4nZ2dnZfqn_adnZ2d@brightview.co.uk>
<uque87$1i55a$2@dont-email.me> <uqv1nm$1ovej$1@dont-email.me>
<uqvo4k$1tfor$1@dont-email.me> <uqvrjm$1u9qq$2@dont-email.me>
<uqvtg6$1uo1n$1@dont-email.me> <ur01nj$1vmpt$1@dont-email.me>
<ur0372$200ou$1@dont-email.me> <ur1e9d$2bqel$2@dont-email.me>
<ur1tpj$2emq1$2@dont-email.me> <ur2pum$2kfm3$1@dont-email.me>
<ur2qtj$2k2bi$2@dont-email.me> <ur2r4v$2kfm3$3@dont-email.me>
<ur4a3s$30fpu$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 21 Feb 2024 16:25:50 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f679441fdf6cd96c59400d664f91e949";
logging-data="3419339"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19qPXMp9drdStgbZFWafr8hAM/OqIpkZbI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:sK6PxwV64FGV0dcvNd8hflLqDqI=
In-Reply-To: <ur4a3s$30fpu$2@dont-email.me>
Content-Language: en-US
 by: James Kuyper - Wed, 21 Feb 2024 16:25 UTC

On 2/21/24 02:52, David Brown wrote:
....
> Black holes don't bend light any more than any other object with the
> same mass. It's just that you can get closer to a black hole without
> being inside it. (And gravity does not "bend" light - mass bends
> space-time, and the light goes in a straight line in the bent space-time.)

Not quite. Light follows null geodesics in the curved space-time. A
geodesic is an extension of the idea of straight lines to curved
spacetimes. In flat space time (which implies no gravity), geodesics are
straight lines. However, in curved space times, geodesics can be much
more complicated shapes.

Re: [OT] was Re: How About Disallowing Assignments In Expressions?

<ur64vm$3f1dq$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.chmurka.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.c
Subject: Re: [OT] was Re: How About Disallowing Assignments In Expressions?
Date: Thu, 22 Feb 2024 01:37:09 +0100
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <ur64vm$3f1dq$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uqauo4$11vps$1@dont-email.me>
<uqbrjo$16jcf$6@dont-email.me> <uqg3m0$258lu$5@dont-email.me>
<uqgpd1$29928$3@dont-email.me> <87il2s9fdj.fsf@nosuchdomain.example.com>
<uqj95e$2qhb1$1@dont-email.me> <sEazN.324764$Wp_8.34532@fx17.iad>
<86wmr6z0zg.fsf@linuxsc.com> <uql32m$3apfo$1@dont-email.me>
<uql4lr$3avsv$1@dont-email.me> <uqr2cn$ilis$1@dont-email.me>
<uqr5t0$jcff$1@dont-email.me> <uqrlpo$mhj5$1@dont-email.me>
<uqrqml$n43b$7@dont-email.me> <uqt57b$16rno$1@dont-email.me>
<uqth9q$1cn02$1@dont-email.me> <87ttm5ieqp.fsf@bsb.me.uk>
<uqu2ia$1g7ff$1@dont-email.me>
<C1GdneKfeajoBk_4nZ2dnZfqn_adnZ2d@brightview.co.uk>
<uque87$1i55a$2@dont-email.me> <uqv1nm$1ovej$1@dont-email.me>
<uqvo4k$1tfor$1@dont-email.me> <uqvrjm$1u9qq$2@dont-email.me>
<uqvtg6$1uo1n$1@dont-email.me> <ur01nj$1vmpt$1@dont-email.me>
<ur0372$200ou$1@dont-email.me> <ur1e9d$2bqel$2@dont-email.me>
<ur1tpj$2emq1$2@dont-email.me> <ur2pum$2kfm3$1@dont-email.me>
<ur2qtj$2k2bi$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 22 Feb 2024 00:37:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="90747243d2c7ad0519d7d8b17156f7ba";
logging-data="3638714"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/2uL4mZlJQd60Ex2HV5exW"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:Orr3wR74g5sPAEKlc3+kJVRj1s8=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <ur2qtj$2k2bi$2@dont-email.me>
 by: Janis Papanagnou - Thu, 22 Feb 2024 00:37 UTC

On 20.02.2024 19:26, Lew Pitcher wrote:
> On Tue, 20 Feb 2024 18:10:30 +0000, Richard Harnden wrote:
>>
>> Why wouldn't light be travelling in a straight line?
>
> Refraction, either by a change in medium or gravity (or some other force).
> That's the stuff lenses (physical and gravitational) are made of :-)

There's an interesting atmospheric condition seen at the Alps (Europe)
that's called "Föhn". Warm winds from the south (Italy) are streaming
over the mountains. At the German side there's cold air and the warm
air streams over that cold air. The different density of the cold/warm
air "bends" the line of sight so that the mountains appear to be much
higher than they effectively are (i.e. as seen on non-Föhn condition).
This refraction effect is depicted in the picture behind the link[*];
blue is the line of sight, and red is the perceived line of sight.

Janis

[*]
https://upload.wikimedia.org/wikipedia/commons/thumb/3/35/Foehn_Lichtweg.svg/640px-Foehn_Lichtweg.svg.png

Re: How About Disallowing Assignments In Expressions?

<uvloti53cog8e3nr8ooomfk3ds122dvbfs@4ax.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dave_tho...@comcast.net
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Mon, 26 Feb 2024 04:22:06 -0500
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <uvloti53cog8e3nr8ooomfk3ds122dvbfs@4ax.com>
References: <uq3s76$28dsr$1@dont-email.me> <uq4nmb$2hive$6@dont-email.me> <87r0hlef8q.fsf@nosuchdomain.example.com> <8734u1e424.fsf@nosuchdomain.example.com> <20240209141128.782@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="4fc000dd80b5f2898b8276ffc73dd31d";
logging-data="2591599"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/3+HYUY2WhyLbkbBk5uD34Lnq0xnOOmAY="
Cancel-Lock: sha1:zz0Eo5osakvotxI2SZKCaK8xqrs=
X-Newsreader: Forte Agent 3.3/32.846
 by: dave_tho...@comcast.net - Mon, 26 Feb 2024 09:22 UTC

On Fri, 9 Feb 2024 22:14:19 -0000 (UTC), Kaz Kylheku
<433-929-6894@kylheku.com> wrote:

> On 2024-02-09, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

> > If I were designing a new language, I'd consider using ":=" for
> > assignment, "==" for equality, and not using "=" for anything.
> >
> > In (nearly?) all languages I'm aware of, ":=" either doesn't exist or
> > means assignment, and "==" either doesn't exist or means equality. I'd
> > avoid "=" because it's ambiguous across languages (and that's almost
> > entirely C's fault, inherited from B).
>
> Some of the credit must go to classic BASIC!
>
> I seem to remember than in classic, line-numbered BASICs on 8 bit
> micros, the = token was used both for assignment and comparison!
>
> 300 I = I + 1
> 310 IF I = 10 GOTO 340
>
BASIC itself predates (B and) C, but 8 bit micros are at least 5 years
too late.

> If you have a dedicated assignment statement, you can pull this kind
> of stunt. Just like C can distinguish initialization from assignment.

And I'm pretty sure Dartmouth BASIC required LET var = expr, which
(more) clearly distinguished it from IF.

COBOL used = for both one type of assignment (requiring keyword
COMPUTE) and equality. (The other types of assignment didn't use any
punctuator at all.) PL/I used it for both, with assignment 'bare'.

Re: How About Disallowing Assignments In Expressions?

<urkho1$3681a$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Tue, 27 Feb 2024 12:40:47 +0100
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <urkho1$3681a$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq4nmb$2hive$6@dont-email.me>
<87r0hlef8q.fsf@nosuchdomain.example.com>
<8734u1e424.fsf@nosuchdomain.example.com> <20240209141128.782@kylheku.com>
<uvloti53cog8e3nr8ooomfk3ds122dvbfs@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Feb 2024 11:40:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="bd525e439c6b5ce1313397c379b983be";
logging-data="3350570"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Rw0+79JJwRLI4kui0/rtW"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:KZon5zrj9CN9ReiTMJOhigQ5/kA=
In-Reply-To: <uvloti53cog8e3nr8ooomfk3ds122dvbfs@4ax.com>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Tue, 27 Feb 2024 11:40 UTC

On 26.02.2024 10:22, dave_thompson_2@comcast.net wrote:
> On Fri, 9 Feb 2024 22:14:19 -0000 (UTC), Kaz Kylheku
> <433-929-6894@kylheku.com> wrote:
>> On 2024-02-09, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>
>>> If I were designing a new language, I'd consider using ":=" for
>>> assignment, "==" for equality, and not using "=" for anything.
>>>
>>> In (nearly?) all languages I'm aware of, ":=" either doesn't exist or
>>> means assignment, and "==" either doesn't exist or means equality.

In Simula you have '=' (equality) and '==' (identity; for references),
and of course ':=' (value assignments) and ':-' (reference assignments).

>>> I'd
>>> avoid "=" because it's ambiguous across languages (and that's almost
>>> entirely C's fault, inherited from B).
>>
>> Some of the credit must go to classic BASIC!

Don't forget FORTRAN (appearing before BASIC). And here also the syntax
ambiguity it had with loops and assignments (but I forgot the details).

>>
>> I seem to remember than in classic, line-numbered BASICs on 8 bit
>> micros, the = token was used both for assignment and comparison!
>>
>> 300 I = I + 1
>> 310 IF I = 10 GOTO 340
>>
> BASIC itself predates (B and) C, but 8 bit micros are at least 5 years
> too late.
>
>> If you have a dedicated assignment statement, you can pull this kind
>> of stunt. Just like C can distinguish initialization from assignment.
>
> And I'm pretty sure Dartmouth BASIC required LET var = expr, which
> (more) clearly distinguished it from IF.

Not all BASIC dialects "required" 'LET'. (A BASIC pocket calculator
from the 1970's that I still have allows omitting the keyword. But
wasn't that quite typical for the BASIC home PCs that came later?)

Janis

> [...]

Re: How About Disallowing Assignments In Expressions?

<urknk6$37eju$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Tue, 27 Feb 2024 13:21:11 +0000
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <urknk6$37eju$1@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq4nmb$2hive$6@dont-email.me>
<87r0hlef8q.fsf@nosuchdomain.example.com>
<8734u1e424.fsf@nosuchdomain.example.com> <20240209141128.782@kylheku.com>
<uvloti53cog8e3nr8ooomfk3ds122dvbfs@4ax.com> <urkho1$3681a$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Feb 2024 13:21:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="20b1b8f346f60418f3ea58d335a2a8b5";
logging-data="3390078"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/jaBoUjldgitjxh0A9MM1lQB2Uj4JVIZc="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:VW7RFqWT6oHcH70O2UihUNHcqz4=
Content-Language: en-GB
In-Reply-To: <urkho1$3681a$1@dont-email.me>
 by: bart - Tue, 27 Feb 2024 13:21 UTC

On 27/02/2024 11:40, Janis Papanagnou wrote:
> On 26.02.2024 10:22, dave_thompson_2@comcast.net wrote:
>> On Fri, 9 Feb 2024 22:14:19 -0000 (UTC), Kaz Kylheku
>> <433-929-6894@kylheku.com> wrote:
>>> On 2024-02-09, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>>
>>>> If I were designing a new language, I'd consider using ":=" for
>>>> assignment, "==" for equality, and not using "=" for anything.
>>>>
>>>> In (nearly?) all languages I'm aware of, ":=" either doesn't exist or
>>>> means assignment, and "==" either doesn't exist or means equality.
>
> In Simula you have '=' (equality) and '==' (identity; for references),
> and of course ':=' (value assignments) and ':-' (reference assignments).
>
>>>> I'd
>>>> avoid "=" because it's ambiguous across languages (and that's almost
>>>> entirely C's fault, inherited from B).
>>>
>>> Some of the credit must go to classic BASIC!
>
> Don't forget FORTRAN (appearing before BASIC). And here also the syntax
> ambiguity it had with loops and assignments (but I forgot the details).

do 100 i = 1,10
do 100 i = 1.10

(FORTRAN ignores embedded white space.) The first is a loop over 1..10
delimited by label 100.

The second assigns 1.10 to variable `do100i`.

So it's not really ambiguous, but it is error prone.

Re: How About Disallowing Assignments In Expressions?

<urqt0d$q9h9$4@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 29 Feb 2024 21:29:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <urqt0d$q9h9$4@dont-email.me>
References: <uq3s76$28dsr$1@dont-email.me> <uq4nmb$2hive$6@dont-email.me>
<87r0hlef8q.fsf@nosuchdomain.example.com>
<8734u1e424.fsf@nosuchdomain.example.com> <20240209141128.782@kylheku.com>
<uvloti53cog8e3nr8ooomfk3ds122dvbfs@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Feb 2024 21:29:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="daeb6559b2144face1d3464670b018f1";
logging-data="861737"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19qyoGbL7e8FMYTgrzhAPPF"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:x7sjHOjuzooEBCdaJYDpJ1N6zII=
 by: Lawrence D'Oliv - Thu, 29 Feb 2024 21:29 UTC

On Mon, 26 Feb 2024 04:22:06 -0500, dave_thompson_2 wrote:

> And I'm pretty sure Dartmouth BASIC required LET var = expr, which
> (more) clearly distinguished it from IF.

And they brought out their own “True BASIC” which did exactly this, to try
to compete against Microsoft BASIC, which they saw as being not “true” to
their original idea of BASIC.

I don’t think it did very well.

Pages:123456789101112131415161718192021
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor