> Pascal makes the same difference between := (assignment) and = (comparison)

Pascal is a castrated version of Algol 60,

> So does C.

You're missing  Charles Mills's point; in C it is easy to type "=" where you 
meant "=="; typing ":=" when you meant "=" is much less likely. 

--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf of 
Bernd Oppolzer <bernd.oppol...@t-online.de>
Sent: Tuesday, July 16, 2019 2:32 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Where put the notional constant in a condition (Was RE: JCL COND 
Parameter)

and Pascal :-)
Pascal makes the same difference between := (assignment) and = (comparison)
So does C.

BTW: a free Pascal compiler for mainframe targets:
http://secure-web.cisco.com/1d8g6NdaGnJSXOoPGlsW_cuVr7ZvTMNJ5ogRpamvCfkPhwhx9zcEEOPIpkyJVujXTdvtZkWWshMq8mXK79ppXOiSSvBNhUKGV72cmsukk1EySOc-rMN4_N5Ec0hjbOwDth-9lzTMfMO5roFPpPA-jcIoQbH2YwovmfQdaFeeHYhs5NoVlNsET0QMBIt7BynNelS9LDo0NlURN4zCrj4YNgosaQk6qFOlRTBGGClki-jSTcDFbXfwTbkxsPQVwNT5wwyTIcBKCqWsfQShkcZ4lOkDDEzAheIu57CR6AtCNeJLgeN0SyzjibeBWobne-wrta1udZRWF_a0Aw2nd3jw9Lp0DBOgL4Mf9pIauDWcO9XnM0lSuo-Cdjo6k2BGT6lbNmghn_R4tTk6DoEYkcndptrXSpeOQ-aL9h1CXhiVd9Gq82Z61XLLt8lvfZPETWA1f/http%3A%2F%2Fbernd-oppolzer.de%2Fjob9.htm
https://secure-web.cisco.com/1bQnEidc5Dqd3wuG5_Vm65bxLQ3PfeJOp6_TL2osPgyPBaZ5qP_otTJlCsEFuiCpA1so086uAX9SqPMVqqU6_QRH07ar9Ga9PCpBsaMkTk3ujKgRmfljYTWcHo08q_4mA8smsTxpVaHN4qdPKU2HatdrJi1gOfkkn1D_w2036Sy2SQC9bIeXXsDDFvN9HXOVBP_715bN8Qq7EU6dzCow-YheDQURYbjBDdVoqf8g8-yZwxZH0IJqmDawtaRAuuOfx1dSm2FCTRgbfGCDjv_RmpklU5fQKqpbqyq-GbmzcsxToLD4I_0zpH4AVeERO5AXQoyKpNQfETya_lNokM-VA-dT_uzNgYxOL1Vo5Z5Qsev_-j06ahMBJ84YoQx9yYtONUbZNq-6pCJcyS48fPcziZ8CwobnGiUGlwr3C8hF65CvKLe4Xl0jt2hL0zvsy7Vn0/https%3A%2F%2Fwww.facebook.com%2FStanfordPascal
https://secure-web.cisco.com/1H-srYcgPyNO8FskL4JjcZXVkCuKFITGP0xjdhqdYc7TMRGjiJcLuyxUxoewgz6vBi-Hg1Qa43hOB5qRchMLlfqrBgSFU05PBn3hIO1fCVcP__3_1en5VH9i2hiwF7nTSALZcZtsrk8aTPKON-TOG_ODRAyUjfOjSgXB8yHVkXqgvv0sZU9bX7z_Hjflo5wMdJZc75L3BKZyXpLBeE5AaziVtI60jzoVZA1zQJ8ioWMPrEO2-DYGUGznrxwVe6j0M8KVEbl-6sqp8t3o1_59fFLq5m6orzXCBQdQTngav2tKm6aZ28JalAwPLfrRU3xpfIL_fw_nh3EhWxqOrHQoUhPSJtNKY1nPQmNGe1U60U75mcLsBfWc3IeZMLVHRhDHZkT437LAu8pq7OYG89avC-NlnJHAAF2RZt6QSPXKwF7C-2DbWjpNbN6Ms7obl8dDG/https%3A%2F%2Fgithub.com%2FStanfordPascal%2FPascal
unfortunately only AMODE 24 at the moment.
Feel free to send comments offline :-)

Kind regards

Bernd


Am 16.07.2019 um 20:04 schrieb Seymour J Metz:
> One of the things that I liked about Algol was that "=" was always a 
> comparison operator; assignment was ":=". But even in PL/I that particular 
> error is impossible: the "=" in "IF foo=bar" can never be interpreted as 
> assignment.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
> ________________________________________
> From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf of 
> Tom Marchant <0000000a2a8c2020-dmarc-requ...@listserv.ua.edu>
> Sent: Monday, July 15, 2019 4:44 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: Where put the notional constant in a condition (Was RE: JCL COND 
> Parameter)
>
> On Mon, 15 Jul 2019 13:30:51 -0700, Charles Mills wrote:
>
>> Some C programmers are fond of if (7 == foo) rather than the more 
>> conventional if (foo == 7) because if one gets in the habit of doing so and 
>> then accidentally codes if (7 = foo) one gets a compile error rather than 
>> unexpected behavior.
>>
>> For those not familiar with C, foo == 7 is a relational expression, foo = 7 
>> is an assignment, and if (foo = 7) ... compiles as though one had coded
>>
>> foo = 7; if (foo != 0) /* which will be true of course */ ...
>>
>> which is not at all what was presumably intended.
>>
>> 7 = foo is always a compile-time error; you can't assign a variable to a 
>> constant.
> It's one of the things that I don't like about C.
> While you can code if 7 = foo and the compiler will catch your error, there 
> is nothing
> you can do to protect yourself against the mistake of if foo = bar.
>
> --
> Tom Marchant
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to