Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Were there no women, men might live like gods." -- Thomas Dekker


computers / comp.os.vms / Re: VMS process communication

SubjectAuthor
* VMS process communicationArne Vajhøj
+* Re: VMS process communicationJohn Forkosh
|`- Re: VMS process communicationArne Vajhøj
+* Re: VMS process communicationDave Froble
|+* Re: VMS process communicationSingle Stage to Orbit
||`* Re: VMS process communicationCraig A. Berry
|| `* Re: VMS process communicationArne Vajhøj
||  +- Re: VMS process communicationDave Froble
||  +* Re: VMS process communicationArne Vajhøj
||  |`* Re: VMS process communicationJan-Erik Söderholm
||  | `* Re: VMS process communicationSingle Stage to Orbit
||  |  `* Re: VMS process communicationArne Vajhøj
||  |   `* Re: VMS process communicationJan-Erik Söderholm
||  |    +* Re: VMS process communicationArne Vajhøj
||  |    |`- Re: VMS process communicationArne Vajhøj
||  |    `- Re: VMS process communicationStephen Hoffman
||  `* Re: VMS process communicationArne Vajhøj
||   `* Re: VMS process communicationIan Miller
||    `* Re: VMS process communicationJohn Reagan
||     `* Re: VMS process communicationArne Vajhøj
||      `- Re: VMS process communicationArne Vajhøj
|+* Re: VMS process communicationMarc Van Dyck
||`- Re: VMS process communicationSingle Stage to Orbit
|`* Re: VMS process communicationLee Gleason
| +* Re: VMS process communicationDave Froble
| |`* Re: VMS process communicationRobert A. Brooks
| | +- Re: VMS process communicationDave Froble
| | `- Re: VMS process communicationRichard Maher
| `* Re: VMS process communicationArne Vajhøj
|  `* Re: VMS process communicationDave Froble
|   `* Re: VMS process communicationArne Vajhøj
|    +- Re: VMS process communicationStephen Hoffman
|    +- Re: VMS process communicationRichard Maher
|    `- Re: VMS process communicationDave Froble
+* Re: VMS process communicationBob Gezelter
|+* Re: VMS process communicationSimon Clubley
||`* Re: VMS process communicationBob Gezelter
|| `* Re: VMS process communicationDave Froble
||  `* Re: VMS process communicationStephen Hoffman
||   `* Re: VMS process communicationDave Froble
||    `* Re: VMS process communicationStephen Hoffman
||     `* Re: VMS process communicationDave Froble
||      `* Re: VMS process communicationSimon Clubley
||       `* Re: VMS process communicationDave Froble
||        `- Re: VMS process communicationFred. Zwarts
|+- Re: VMS process communicationStephen Hoffman
|`- Re: VMS process communicationArne Vajhøj
+* Re: VMS process communicationMarc Van Dyck
|`* Re: VMS process communicationArne Vajhøj
| +- Re: VMS process communicationCraig A. Berry
| `* Re: VMS process communicationDave Froble
|  +- Re: VMS process communicationArne Vajhøj
|  `* Re: VMS process communicationJan-Erik Söderholm
|   `* Re: VMS process communicationRichard Maher
|    +* Re: VMS process communicationDave Froble
|    |`- Re: VMS process communicationRichard Maher
|    +* Re: VMS process communicationArne Vajhøj
|    |`* Re: VMS process communicationArne Vajhøj
|    | `* Re: VMS process communicationSimon Clubley
|    |  `- Re: VMS process communicationArne Vajhøj
|    `* Re: VMS process communicationStephen Hoffman
|     `* Re: VMS process communicationRichard Maher
|      `- Re: VMS process communicationStephen Hoffman
`* Re: VMS process communicationArne Vajhøj
 +* Re: VMS process communicationSimon Clubley
 |`* Re: VMS process communicationArne Vajhøj
 | `* Re: VMS process communicationArne Vajhøj
 |  +* Re: VMS process communicationCraig A. Berry
 |  |+* Re: VMS process communicationArne Vajhøj
 |  ||`* Re: VMS process communicationSimon Clubley
 |  || `* Re: VMS process communicationArne Vajhøj
 |  ||  `* Re: VMS process communicationSimon Clubley
 |  ||   +* Re: VMS process communicationArne Vajhøj
 |  ||   |`* Re: VMS process communicationDave Froble
 |  ||   | +- Re: VMS process communicationArne Vajhøj
 |  ||   | `* Re: VMS process communicationSimon Clubley
 |  ||   |  `* Re: VMS process communicationDave Froble
 |  ||   |   `* Re: VMS process communicationArne Vajhøj
 |  ||   |    +* Re: VMS process communicationArne Vajhøj
 |  ||   |    |`* Re: VMS process communicationSimon Clubley
 |  ||   |    | `* Re: VMS process communicationArne Vajhøj
 |  ||   |    |  `- Re: VMS process communicationSimon Clubley
 |  ||   |    `* Re: VMS process communicationbill
 |  ||   |     +* Re: VMS process communicationArne Vajhøj
 |  ||   |     |`* Re: VMS process communicationSteven Schweda
 |  ||   |     | `* Re: VMS process communicationArne Vajhøj
 |  ||   |     |  +* Re: VMS process communicationSteven Schweda
 |  ||   |     |  |+* Re: VMS process communicationScott Dorsey
 |  ||   |     |  ||+* Re: VMS process communicationSteven Schweda
 |  ||   |     |  |||`- Re: VMS process communicationArne Vajhøj
 |  ||   |     |  ||`- Re: VMS process communicationArne Vajhøj
 |  ||   |     |  |`- Re: VMS process communicationArne Vajhøj
 |  ||   |     |  `* Re: VMS process communicationDave Froble
 |  ||   |     |   +- Re: VMS process communicationSteven Schweda
 |  ||   |     |   `* Re: VMS process communicationArne Vajhøj
 |  ||   |     |    +- Re: VMS process communicationDave Froble
 |  ||   |     |    +* Re: VMS process communicationSteven Schweda
 |  ||   |     |    |`- Re: VMS process communicationArne Vajhøj
 |  ||   |     |    `* Re: VMS process communicationJohnny Billquist
 |  ||   |     |     +* Re: VMS process communicationSteven Schweda
 |  ||   |     |     |`* Re: VMS process communicationJohnny Billquist
 |  ||   |     |     +* Re: VMS process communicationScott Dorsey
 |  ||   |     |     `* Re: VMS process communicationArne Vajhøj
 |  ||   |     `- Re: VMS process communicationDave Froble
 |  ||   `- Re: VMS process communicationJohnny Billquist
 |  |`* Re: VMS process communicationCraig A. Berry
 |  +* Re: VMS process communicationAndreas Gruhl
 |  +* Re: VMS process communicationJOUKJ
 |  +- Re: VMS process communicationSimon Clubley
 |  `* Re: VMS process communicationArne Vajhøj
 `- Re: VMS process communicationArne Vajhøj

Pages:123456789
Re: C limitations, was: Re: VMS process communication

<u17mcf$etu$2@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27487&group=comp.os.vms#27487

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.80-218-16-84.dclient.hispeed.ch!not-for-mail
From: bqt...@softjar.se (Johnny Billquist)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Thu, 13 Apr 2023 03:37:19 +0200
Organization: MGT Consulting
Message-ID: <u17mcf$etu$2@news.misty.com>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<k9o4ddF9sbsU3@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 13 Apr 2023 01:37:20 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="80-218-16-84.dclient.hispeed.ch:80.218.16.84";
logging-data="15294"; mail-complaints-to="abuse@misty.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.9.1
Content-Language: en-US
In-Reply-To: <k9o4ddF9sbsU3@mid.individual.net>
 by: Johnny Billquist - Thu, 13 Apr 2023 01:37 UTC

On 2023-04-12 18:26, bill wrote:
> On 4/7/2023 4:58 PM, Johnny Billquist wrote:
>> On 2023-04-03 14:31, bill wrote:
>>>> PDP-8, as well as very old PDP-11 software usually also used mark
>>>> parity on all characters. And as far as I know, the ASR-33 variant
>>>> that DEC used did this, which might be the reason for all software
>>>> doing it.
>>>
>>> I am not aware of any PDP-11 operating system where the charsets ASCII
>>> values were 128 to 255 as opposed to 0 to 127.  Certainly none where it
>>> was the hardware forcing it.
>>
>> XXDP (the PDP-11 diagnostics) are the oldest PDP-11 software I have
>> been dealing with. A lot of code in there assumes you are running with
>> mark parity, which basically means all output characters will always
>> have the high bit set.
>
> Yes, but there is a big difference between communications parity and
> memory parity.

Uh? Who mentioned memory parity? Not me.
This has all been communication, as such. But the data as such are
generated already with mark parity by compilers. It's not something
added by any hardware. And the parsing of received data is also done
with the assumption that it was received with mark parity, and that is
never stripped away.

Johnny

Re: C limitations, was: Re: VMS process communication

<u18h2q$ban2$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27489&group=comp.os.vms#27489

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jan-erik...@telia.com (Jan-Erik Söderholm)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Thu, 13 Apr 2023 11:12:59 +0200
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <u18h2q$ban2$1@dont-email.me>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<k9o4ddF9sbsU3@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 13 Apr 2023 09:12:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="fbaee91e8a68a5ed757bcca50e5ebc76";
logging-data="371426"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+pfBmdLvGFQZzgELCq8DHN"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.9.1
Cancel-Lock: sha1:TOwy6IvRDI+Tz79QTojCUMCNcyI=
Content-Language: sv
In-Reply-To: <k9o4ddF9sbsU3@mid.individual.net>
 by: Jan-Erik Söderholm - Thu, 13 Apr 2023 09:12 UTC

Den 2023-04-12 kl. 18:26, skrev bill:

> But that is only during communications.  I am not aware of any program
> that computed the value of a character in transit and cared what that
> value was.  Pr1me set the values in their firmware forcing all programs
> in any language to deal with an ASCII set that had values from 128 to
> 255.

Now, if the highest bit really was a parity bit, you would end up with
values in the whole range 0-255, depending on the number of 1's in the
lower 7 bits.

But maybe that wasn't a real parity bit...

Re: C limitations, was: Re: VMS process communication

<k9q8g4Fq0fdU2@mid.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27492&group=comp.os.vms#27492

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!lilly.ping.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bill.gun...@gmail.com (bill)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Thu, 13 Apr 2023 07:48:19 -0400
Lines: 42
Message-ID: <k9q8g4Fq0fdU2@mid.individual.net>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<k9o4ddF9sbsU3@mid.individual.net> <u17mcf$etu$2@news.misty.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net CuQT6NIR1xEb2ShJ43jKtAfTMAS4+APRBU7Q9ziHti3GC5BL4a
Cancel-Lock: sha1:MhDy7afpXJKsxViQrQK+9Naiz8U=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.10.0
Content-Language: en-US
In-Reply-To: <u17mcf$etu$2@news.misty.com>
 by: bill - Thu, 13 Apr 2023 11:48 UTC

On 4/12/2023 9:37 PM, Johnny Billquist wrote:
> On 2023-04-12 18:26, bill wrote:
>> On 4/7/2023 4:58 PM, Johnny Billquist wrote:
>>> On 2023-04-03 14:31, bill wrote:
>>>>> PDP-8, as well as very old PDP-11 software usually also used mark
>>>>> parity on all characters. And as far as I know, the ASR-33 variant
>>>>> that DEC used did this, which might be the reason for all software
>>>>> doing it.
>>>>
>>>> I am not aware of any PDP-11 operating system where the charsets ASCII
>>>> values were 128 to 255 as opposed to 0 to 127.  Certainly none where it
>>>> was the hardware forcing it.
>>>
>>> XXDP (the PDP-11 diagnostics) are the oldest PDP-11 software I have
>>> been dealing with. A lot of code in there assumes you are running
>>> with mark parity, which basically means all output characters will
>>> always have the high bit set.
>>
>> Yes, but there is a big difference between communications parity and
>> memory parity.
>
> Uh? Who mentioned memory parity? Not me.

I did.

> This has all been communication, as such. But the data as such are
> generated already with mark parity by compilers. It's not something
> added by any hardware. And the parsing of received data is also done
> with the assumption that it was received with mark parity, and that is
> never stripped away.

I thought we were talking about C and it's limitations and the concept
of data types. And then there was the thing about signed and unsigned
chars. And that led to my mentioning a case where not only are chars
(kinda) signed but they always have the high order bit on. And how that
posed a problem porting software because so much of the C software being
moved around (in places like comp.sources.xxx) were written with the
assumption that chars fell in the 0-127 value range.

bill

Re: C limitations, was: Re: VMS process communication

<u18rqh$eb71$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27499&group=comp.os.vms#27499

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Thu, 13 Apr 2023 12:16:17 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <u18rqh$eb71$1@dont-email.me>
References: <631fb9a1$0$703$14726298@news.sunsite.dk> <tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net> <tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me> <tvt4jf$b82$1@news.misty.com> <4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu> <tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com> <k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com> <k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com> <u16fvo$32arb$1@dont-email.me> <u16g44$32arb$2@dont-email.me> <u17m5s$etu$1@news.misty.com>
Injection-Date: Thu, 13 Apr 2023 12:16:17 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="00f4e2389b12469588d1da5b6c25d9cb";
logging-data="470241"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0mDf0QjGzY+Ad/0wfCCsdnlg68YACzF0="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:WtkvYppZEf4ZlthPiVwBgFitDZM=
 by: Simon Clubley - Thu, 13 Apr 2023 12:16 UTC

On 2023-04-12, Johnny Billquist <bqt@softjar.se> wrote:
>
> but I'd say that is less common, and a bad programmer will always manage
> to write bad code, no matter what language. That don't mean the language
> is bad. It is just more unclear, and in C there is no performance
> reason, or anything else giving any reason why you would write 48, when
> '0' is so much clearer what the intent is. And then it also works if you
> use another character set, as long as all the digits have consecutive
> code points.
>

I wonder how the EDCDIC people handle this and your other examples ? :-)

(A-Z is not a contiguous unbroken sequence in EBCDIC.)

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: C limitations, was: Re: VMS process communication

<u18s2b$ecpe$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27502&group=comp.os.vms#27502

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Thu, 13 Apr 2023 12:20:27 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <u18s2b$ecpe$1@dont-email.me>
References: <631fb9a1$0$703$14726298@news.sunsite.dk> <tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net> <tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me> <tvt4jf$b82$1@news.misty.com> <4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu> <tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com> <k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com> <k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com> <k9o4ddF9sbsU3@mid.individual.net> <u18h2q$ban2$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 13 Apr 2023 12:20:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="00f4e2389b12469588d1da5b6c25d9cb";
logging-data="471854"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/GP93y0UzH4uQ/VwC/LgrfqH7KVG1j7Dw="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:AWWovIIUDqbrxluGCEomug0ACQ0=
 by: Simon Clubley - Thu, 13 Apr 2023 12:20 UTC

On 2023-04-13, Jan-Erik Söderholm <jan-erik.soderholm@telia.com> wrote:
> Den 2023-04-12 kl. 18:26, skrev bill:
>
>> But that is only during communications.  I am not aware of any program
>> that computed the value of a character in transit and cared what that
>> value was.  Pr1me set the values in their firmware forcing all programs
>> in any language to deal with an ASCII set that had values from 128 to
>> 255.
>
>
> Now, if the highest bit really was a parity bit, you would end up with
> values in the whole range 0-255, depending on the number of 1's in the
> lower 7 bits.
>
> But maybe that wasn't a real parity bit...
>

There's such a thing as mark parity (and space parity) although it
sounds like you've never had the misfortune to come across them... :-)

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: C limitations, was: Re: VMS process communication

<memo.20230413185518.10336E@jgd.cix.co.uk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27516&group=comp.os.vms#27516

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jgd...@cix.co.uk (John Dallman)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Thu, 13 Apr 2023 18:55 +0100 (BST)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <memo.20230413185518.10336E@jgd.cix.co.uk>
References: <k8jc4aFmhtrU2@mid.individual.net>
Reply-To: jgd@cix.co.uk
Injection-Info: dont-email.me; posting-host="066ad2fb4fc36316bd745281f081dc82";
logging-data="1147280"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+wAg6MA3nyzgGEq6ARI5er6/8ZzCSD5qY="
Cancel-Lock: sha1:JODN4L5gFdNm4hNv3eK+IhNNnOY=
 by: John Dallman - Thu, 13 Apr 2023 17:55 UTC

In article <k8jc4aFmhtrU2@mid.individual.net>, bill.gunshannon@gmail.com
(bill) wrote:

> Weird? What about under Primos where chars always have the high
> order bit turned on? It was called "mark memory parity" but it
> never made any sense to me when I had to work with it. :-)

You've explained a mystery from 40 years ago. My undergraduate project
was doing animation on a strange colour graphics vector terminal
connected to a Prime 750 running PrimeOS. There were several weeks of
delays while it was got working with PrimeOS, and I never found out why.
It was driven over a serial line and its command language encoded
coordinates in the binary values of ASCII characters. Suddenly, the
problem is obvious.

John

Re: C limitations, was: Re: VMS process communication

<k9r2stFq0fdU3@mid.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27517&group=comp.os.vms#27517

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bill.gun...@gmail.com (bill)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Thu, 13 Apr 2023 15:18:53 -0400
Lines: 21
Message-ID: <k9r2stFq0fdU3@mid.individual.net>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<u16fvo$32arb$1@dont-email.me> <u16g44$32arb$2@dont-email.me>
<u17m5s$etu$1@news.misty.com> <u18rqh$eb71$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net DJb9KjzPmUgvaJlbtUDTIwWqx426qBU92g28e+vCP5RoFyjJ3U
Cancel-Lock: sha1:t2JgXInbpzbpqaLAxD1fEcw2n2g=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.10.0
Content-Language: en-US
In-Reply-To: <u18rqh$eb71$1@dont-email.me>
 by: bill - Thu, 13 Apr 2023 19:18 UTC

On 4/13/2023 8:16 AM, Simon Clubley wrote:
> On 2023-04-12, Johnny Billquist <bqt@softjar.se> wrote:
>>
>> but I'd say that is less common, and a bad programmer will always manage
>> to write bad code, no matter what language. That don't mean the language
>> is bad. It is just more unclear, and in C there is no performance
>> reason, or anything else giving any reason why you would write 48, when
>> '0' is so much clearer what the intent is. And then it also works if you
>> use another character set, as long as all the digits have consecutive
>> code points.
>>
>
> I wonder how the EDCDIC people handle this and your other examples ? :-)
>
> (A-Z is not a contiguous unbroken sequence in EBCDIC.)
>

I think they do it mostly by not using C. :-)

bill

Re: C limitations, was: Re: VMS process communication

<memo.20230413214031.10336G@jgd.cix.co.uk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27518&group=comp.os.vms#27518

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jgd...@cix.co.uk (John Dallman)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Thu, 13 Apr 2023 21:40 +0100 (BST)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <memo.20230413214031.10336G@jgd.cix.co.uk>
References: <u18rqh$eb71$1@dont-email.me>
Reply-To: jgd@cix.co.uk
Injection-Info: dont-email.me; posting-host="066ad2fb4fc36316bd745281f081dc82";
logging-data="1194864"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18u5nk71lVOkgIUEldakgb5d8L+nz9boz8="
Cancel-Lock: sha1:xunDcar9lgQviFsxobfQMAgE6Gs=
 by: John Dallman - Thu, 13 Apr 2023 20:40 UTC

In article <u18rqh$eb71$1@dont-email.me>,
clubley@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley) wrote:

> I wonder how the EDCDIC people handle this and your other examples
> ? :-)
>
> (A-Z is not a contiguous unbroken sequence in EBCDIC.)

Linux on IBM Z is an ASCII OS, with no attempt to use EBCDIC.

John

Re: C limitations, was: Re: VMS process communication

<k9r305Fq0fdU4@mid.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27519&group=comp.os.vms#27519

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bill.gun...@gmail.com (bill)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Thu, 13 Apr 2023 15:20:36 -0400
Lines: 22
Message-ID: <k9r305Fq0fdU4@mid.individual.net>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<k9o4ddF9sbsU3@mid.individual.net> <u18h2q$ban2$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net JiBZyscCNi5tF3MyliYCPQ/rxGPK+xJ8plIQGlcyperJG0846A
Cancel-Lock: sha1:CwLyw9SZFkSMtWQ0z1gi/kcoFQw=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.10.0
Content-Language: en-US
In-Reply-To: <u18h2q$ban2$1@dont-email.me>
 by: bill - Thu, 13 Apr 2023 19:20 UTC

On 4/13/2023 5:12 AM, Jan-Erik Söderholm wrote:
> Den 2023-04-12 kl. 18:26, skrev bill:
>
>> But that is only during communications.  I am not aware of any program
>> that computed the value of a character in transit and cared what that
>> value was.  Pr1me set the values in their firmware forcing all programs
>> in any language to deal with an ASCII set that had values from 128 to
>> 255.
>
>
> Now, if the highest bit really was a parity bit, you would end up with
> values in the whole range 0-255, depending on the number of 1's in the
> lower 7 bits.
>
> But maybe that wasn't a real parity bit...
>

They always referred to it as "Mark Memory Parity". Knowing the
function of parity I never understood just what they thought it did.

bill

Re: C limitations, was: Re: VMS process communication

<5f6abdcf8af80fcb52370a1f306758142ce72e74.camel@munted.eu>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27521&group=comp.os.vms#27521

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!palladium.buellnet!not-for-mail
From: alex.bu...@munted.eu (Single Stage to Orbit)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Thu, 13 Apr 2023 23:10:34 +0100
Organization: One very high maintenance cat
Message-ID: <5f6abdcf8af80fcb52370a1f306758142ce72e74.camel@munted.eu>
References: <u18rqh$eb71$1@dont-email.me>
<memo.20230413214031.10336G@jgd.cix.co.uk>
Reply-To: alex.buell@munted.eu
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: solani.org;
logging-data="3618547"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Evolution 3.46.4
Cancel-Lock: sha1:cLJqQeyEvX4JGKzeGd00byAQHlY=
X-User-ID: eJwNyEkBwDAIBEBLnAvICQn4l9DOc1zBuGFwmK9vkhRNmggPwJ3bzagKbe2hffaf6RRXrOPIq3MFy6Flm/gAMo4Uuw==
In-Reply-To: <memo.20230413214031.10336G@jgd.cix.co.uk>
 by: Single Stage to Orbi - Thu, 13 Apr 2023 22:10 UTC

On Thu, 2023-04-13 at 21:40 +0100, John Dallman wrote:
> > (A-Z is not a contiguous unbroken sequence in EBCDIC.)
>
> Linux on IBM Z is an ASCII OS, with no attempt to use EBCDIC.

UTF-8 OS, actually.
--
Tactical Nuclear Kittens

Re: C limitations, was: Re: VMS process communication

<u1bghf$1hiv2$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27525&group=comp.os.vms#27525

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Fri, 14 Apr 2023 12:22:08 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <u1bghf$1hiv2$2@dont-email.me>
References: <631fb9a1$0$703$14726298@news.sunsite.dk> <tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net> <tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me> <tvt4jf$b82$1@news.misty.com> <4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu> <tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com> <k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com> <k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com> <u16fvo$32arb$1@dont-email.me> <u16g44$32arb$2@dont-email.me> <u17m5s$etu$1@news.misty.com> <u18rqh$eb71$1@dont-email.me> <k9r2stFq0fdU3@mid.individual.net>
Injection-Date: Fri, 14 Apr 2023 12:22:08 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e10fd70d0b91e57f714abe6e32cb2e0e";
logging-data="1625058"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DhDhkJIOw/FOOLZrEhShHEIzJBtZcJYc="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:o7g7N6GCj9OwH/NKZBep7/WCvAM=
 by: Simon Clubley - Fri, 14 Apr 2023 12:22 UTC

On 2023-04-13, bill <bill.gunshannon@gmail.com> wrote:
> On 4/13/2023 8:16 AM, Simon Clubley wrote:
>> On 2023-04-12, Johnny Billquist <bqt@softjar.se> wrote:
>>>
>>> but I'd say that is less common, and a bad programmer will always manage
>>> to write bad code, no matter what language. That don't mean the language
>>> is bad. It is just more unclear, and in C there is no performance
>>> reason, or anything else giving any reason why you would write 48, when
>>> '0' is so much clearer what the intent is. And then it also works if you
>>> use another character set, as long as all the digits have consecutive
>>> code points.
>>>
>>
>> I wonder how the EDCDIC people handle this and your other examples ? :-)
>>
>> (A-Z is not a contiguous unbroken sequence in EBCDIC.)
>>
>
> I think they do it mostly by not using C. :-)
>

Times change. :-) z/OS has a C compiler and now runs open source software.

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: C limitations, was: Re: VMS process communication

<u1bgjj$1hiv2$3@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27526&group=comp.os.vms#27526

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Fri, 14 Apr 2023 12:23:15 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <u1bgjj$1hiv2$3@dont-email.me>
References: <u18rqh$eb71$1@dont-email.me> <memo.20230413214031.10336G@jgd.cix.co.uk>
Injection-Date: Fri, 14 Apr 2023 12:23:15 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e10fd70d0b91e57f714abe6e32cb2e0e";
logging-data="1625058"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BG2uqRi0Id2s1LKwiiIAVcj7oSNeKZqg="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:jq0gGvXcrJDnpIang0zGkT/mcgc=
 by: Simon Clubley - Fri, 14 Apr 2023 12:23 UTC

On 2023-04-13, John Dallman <jgd@cix.co.uk> wrote:
> In article <u18rqh$eb71$1@dont-email.me>,
> clubley@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley) wrote:
>
>> I wonder how the EDCDIC people handle this and your other examples
>> ? :-)
>>
>> (A-Z is not a contiguous unbroken sequence in EBCDIC.)
>
> Linux on IBM Z is an ASCII OS, with no attempt to use EBCDIC.
>

Actually, I wasn't even thinking of Linux. :-)

I was thinking of z/OS, which does have a C compiler...

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: C limitations, was: Re: VMS process communication

<7wsfd2pnch.fsf@junk.nocrew.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27529&group=comp.os.vms#27529

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
From: lars.s...@nocrew.org (Lars Brinkhoff)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Organization: nocrew
References: <k8jc4aFmhtrU2@mid.individual.net>
<memo.20230413185518.10336E@jgd.cix.co.uk>
Date: Fri, 14 Apr 2023 14:09:18 +0000
Message-ID: <7wsfd2pnch.fsf@junk.nocrew.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cancel-Lock: sha1:AbsiizRmpvM8UvM4yioQZ+JUibg=
MIME-Version: 1.0
Content-Type: text/plain
Lines: 10
NNTP-Posting-Host: cac6e09c.news.sunsite.dk
X-Trace: 1681481358 news.sunsite.dk 698 lars@junk.nocrew.org/51.15.56.219:45784
X-Complaints-To: staff@sunsite.dk
 by: Lars Brinkhoff - Fri, 14 Apr 2023 14:09 UTC

John Dallman writes:
> bill.gunshannon wrote:
>> Weird? What about under Primos where chars always have the high
>> order bit turned on? It was called "mark memory parity" but it
>> never made any sense to me when I had to work with it. :-)
> You've explained a mystery from 40 years ago.

How about PrimeOS handling Control-P specially from the input side?
I heard from Prime Emacs people that was awkward, but there was no
workaround other than "don't do that"

Re: C limitations, was: Re: VMS process communication

<k9teprFq0fdU5@mid.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27531&group=comp.os.vms#27531

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bill.gun...@gmail.com (bill)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Fri, 14 Apr 2023 12:54:19 -0400
Lines: 10
Message-ID: <k9teprFq0fdU5@mid.individual.net>
References: <k8jc4aFmhtrU2@mid.individual.net>
<memo.20230413185518.10336E@jgd.cix.co.uk> <7wsfd2pnch.fsf@junk.nocrew.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net P0e8vk/yGg6m4KgabuN5GAsUbQGBsVRTKhaq8wL+udsrDn+w2x
Cancel-Lock: sha1:7SlPdpWkoH3toXbmdkcS2uIqB3I=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.10.0
Content-Language: en-US
In-Reply-To: <7wsfd2pnch.fsf@junk.nocrew.org>
 by: bill - Fri, 14 Apr 2023 16:54 UTC

On 4/14/2023 10:09 AM, Lars Brinkhoff wrote:
>
> How about PrimeOS

A minor nit but there is no such thing as PrimeOS.
There is only PRIMOS and PRIMIX.

bill

Re: C limitations, was: Re: VMS process communication

<u1e90j$7s1$1@panix2.panix.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27542&group=comp.os.vms#27542

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix2.panix.com!panix2.panix.com!not-for-mail
From: klu...@panix.com (Scott Dorsey)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: 15 Apr 2023 13:32:03 -0000
Organization: Former users of Netcom shell (1989-2000)
Lines: 28
Message-ID: <u1e90j$7s1$1@panix2.panix.com>
References: <u18rqh$eb71$1@dont-email.me> <memo.20230413214031.10336G@jgd.cix.co.uk>
Injection-Info: reader2.panix.com; posting-host="panix2.panix.com:166.84.1.2";
logging-data="18395"; mail-complaints-to="abuse@panix.com"
 by: Scott Dorsey - Sat, 15 Apr 2023 13:32 UTC

John Dallman <jgd@cix.co.uk> wrote:
>In article <u18rqh$eb71$1@dont-email.me>,
>clubley@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley) wrote:
>
>> I wonder how the EDCDIC people handle this and your other examples
>> ? :-)
>>
>> (A-Z is not a contiguous unbroken sequence in EBCDIC.)
>
>Linux on IBM Z is an ASCII OS, with no attempt to use EBCDIC.

IBM made a few attempts to use ASCII on those machines, with one model
(I want to say the 360/44) having a bunch of ASCII support instructions.
Never seemed to come to much. A number of manufacturers made
sort-of-compatible machines (like the RCA Spectra/70) that used the /360
instruction set but with ASCII so you couldn't really run /360 code on
them.

So I am pleased that IBM has made another attempt at ASCII on that
architecture.
--scott
some add
>
>John

--
"C'est un Nagra. C'est suisse, et tres, tres precis."

Re: C limitations, was: Re: VMS process communication

<u1go48$g56$2@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27560&group=comp.os.vms#27560

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.80-218-16-84.dclient.hispeed.ch!not-for-mail
From: bqt...@softjar.se (Johnny Billquist)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Sun, 16 Apr 2023 14:02:16 +0200
Organization: MGT Consulting
Message-ID: <u1go48$g56$2@news.misty.com>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<k9o4ddF9sbsU3@mid.individual.net> <u17mcf$etu$2@news.misty.com>
<k9q8g4Fq0fdU2@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 16 Apr 2023 12:02:16 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="80-218-16-84.dclient.hispeed.ch:80.218.16.84";
logging-data="16550"; mail-complaints-to="abuse@misty.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.10.0
Content-Language: en-US
In-Reply-To: <k9q8g4Fq0fdU2@mid.individual.net>
 by: Johnny Billquist - Sun, 16 Apr 2023 12:02 UTC

On 2023-04-13 13:48, bill wrote:
> On 4/12/2023 9:37 PM, Johnny Billquist wrote:
>> On 2023-04-12 18:26, bill wrote:
>>> On 4/7/2023 4:58 PM, Johnny Billquist wrote:
>>>> On 2023-04-03 14:31, bill wrote:
>>>>>> PDP-8, as well as very old PDP-11 software usually also used mark
>>>>>> parity on all characters. And as far as I know, the ASR-33 variant
>>>>>> that DEC used did this, which might be the reason for all software
>>>>>> doing it.
>>>>>
>>>>> I am not aware of any PDP-11 operating system where the charsets ASCII
>>>>> values were 128 to 255 as opposed to 0 to 127.  Certainly none
>>>>> where it
>>>>> was the hardware forcing it.
>>>>
>>>> XXDP (the PDP-11 diagnostics) are the oldest PDP-11 software I have
>>>> been dealing with. A lot of code in there assumes you are running
>>>> with mark parity, which basically means all output characters will
>>>> always have the high bit set.
>>>
>>> Yes, but there is a big difference between communications parity and
>>> memory parity.
>>
>> Uh? Who mentioned memory parity? Not me.
>
> I did.

:-)

>> This has all been communication, as such. But the data as such are
>> generated already with mark parity by compilers. It's not something
>> added by any hardware. And the parsing of received data is also done
>> with the assumption that it was received with mark parity, and that is
>> never stripped away.
>
> I thought we were talking about C and it's limitations and the concept
> of data types.  And then there was the thing about signed and unsigned
> chars.  And that led to my mentioning a case where not only are chars
> (kinda) signed but they always have the high order bit on. And how that
> posed a problem porting software because so much of the C software being
> moved around (in places like comp.sources.xxx) were written with the
> assumption that chars fell in the 0-127 value range.

What C says is that the characters used for coding, which means the
basic alphabet, numbers, special characters, and so on, are required to
be positive, no matter what kind of type a char is (signed or unsigned).
For other characters, as well as how many bits a char actually is, is
implementation defined in C. So if you use Latin-1, any of those (extra)
characters might be represented as a negative number in a char, just as
well as a positive number. And they are both correct according to the
standard.

And then you brought up Primos, which appears to have been using mark
parity for characters, and I pointed out that this was also rather true
of old PDP-8 and PDP-11 systems. And then you somehow got that to be
about memory parity, while I was talking about serial communication.

At this point, it feels like we've gotten lost in what the point was.

Johnny

Re: C limitations, was: Re: VMS process communication

<u1gnnv$g56$1@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27576&group=comp.os.vms#27576

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.80-218-16-84.dclient.hispeed.ch!not-for-mail
From: bqt...@softjar.se (Johnny Billquist)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Sun, 16 Apr 2023 13:55:43 +0200
Organization: MGT Consulting
Message-ID: <u1gnnv$g56$1@news.misty.com>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<u16fvo$32arb$1@dont-email.me> <u16g44$32arb$2@dont-email.me>
<u17m5s$etu$1@news.misty.com> <u18rqh$eb71$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 16 Apr 2023 11:55:44 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="80-218-16-84.dclient.hispeed.ch:80.218.16.84";
logging-data="16550"; mail-complaints-to="abuse@misty.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.10.0
Content-Language: en-US
In-Reply-To: <u18rqh$eb71$1@dont-email.me>
 by: Johnny Billquist - Sun, 16 Apr 2023 11:55 UTC

On 2023-04-13 14:16, Simon Clubley wrote:
> On 2023-04-12, Johnny Billquist <bqt@softjar.se> wrote:
>>
>> but I'd say that is less common, and a bad programmer will always manage
>> to write bad code, no matter what language. That don't mean the language
>> is bad. It is just more unclear, and in C there is no performance
>> reason, or anything else giving any reason why you would write 48, when
>> '0' is so much clearer what the intent is. And then it also works if you
>> use another character set, as long as all the digits have consecutive
>> code points.
>>
>
> I wonder how the EDCDIC people handle this and your other examples ? :-)
>
> (A-Z is not a contiguous unbroken sequence in EBCDIC.)

I know. EBCDIC was despised by most back in the 80s for a reason...
Anyway, my examples were dealing with digits, which do have the property
of being a contiguous unbroken sequence even in EBCDIC...

But in general, EBCDIC will require that people do much more coding that
is very character set aware for some problems. Miserable in general.

Johnny

Re: C limitations, was: Re: VMS process communication

<u1go6f$g56$3@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27577&group=comp.os.vms#27577

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.80-218-16-84.dclient.hispeed.ch!not-for-mail
From: bqt...@softjar.se (Johnny Billquist)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Sun, 16 Apr 2023 14:03:27 +0200
Organization: MGT Consulting
Message-ID: <u1go6f$g56$3@news.misty.com>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<k9o4ddF9sbsU3@mid.individual.net> <u18h2q$ban2$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 16 Apr 2023 12:03:28 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="80-218-16-84.dclient.hispeed.ch:80.218.16.84";
logging-data="16550"; mail-complaints-to="abuse@misty.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.10.0
Content-Language: en-US
In-Reply-To: <u18h2q$ban2$1@dont-email.me>
 by: Johnny Billquist - Sun, 16 Apr 2023 12:03 UTC

On 2023-04-13 11:12, Jan-Erik Söderholm wrote:
> Den 2023-04-12 kl. 18:26, skrev bill:
>
>> But that is only during communications.  I am not aware of any program
>> that computed the value of a character in transit and cared what that
>> value was.  Pr1me set the values in their firmware forcing all programs
>> in any language to deal with an ASCII set that had values from 128 to
>> 255.
>
>
> Now, if the highest bit really was a parity bit, you would end up with
> values in the whole range 0-255, depending on the number of 1's in the
> lower 7 bits.
>
> But maybe that wasn't a real parity bit...

Depends on what kind of parity you are using...
With even or odd parity and 7 bits of data, you are correct. With mark
or space parity, you are incorrect.

Johnny

Re: C limitations, was: Re: VMS process communication

<u1goal$g56$4@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27578&group=comp.os.vms#27578

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.80-218-16-84.dclient.hispeed.ch!not-for-mail
From: bqt...@softjar.se (Johnny Billquist)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Sun, 16 Apr 2023 14:05:41 +0200
Organization: MGT Consulting
Message-ID: <u1goal$g56$4@news.misty.com>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<k9o4ddF9sbsU3@mid.individual.net> <u18h2q$ban2$1@dont-email.me>
<k9r305Fq0fdU4@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 16 Apr 2023 12:05:41 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="80-218-16-84.dclient.hispeed.ch:80.218.16.84";
logging-data="16550"; mail-complaints-to="abuse@misty.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.10.0
Content-Language: en-US
In-Reply-To: <k9r305Fq0fdU4@mid.individual.net>
 by: Johnny Billquist - Sun, 16 Apr 2023 12:05 UTC

On 2023-04-13 21:20, bill wrote:
> On 4/13/2023 5:12 AM, Jan-Erik Söderholm wrote:
>> Den 2023-04-12 kl. 18:26, skrev bill:
>>
>>> But that is only during communications.  I am not aware of any program
>>> that computed the value of a character in transit and cared what that
>>> value was.  Pr1me set the values in their firmware forcing all programs
>>> in any language to deal with an ASCII set that had values from 128 to
>>> 255.
>>
>>
>> Now, if the highest bit really was a parity bit, you would end up with
>> values in the whole range 0-255, depending on the number of 1's in the
>> lower 7 bits.
>>
>> But maybe that wasn't a real parity bit...
>>
>
> They always referred to it as "Mark Memory Parity".  Knowing the
> function of parity I never understood just what they thought it did.

The "memory" part here, makes no sense. This is communication we're
talking about (see your own quote).

But with that said, mark parity do not make much sense, I agree. It
ensures that at least one bit is set in any transmitted byte, and it
helps confirming that you are indeed running at the correct speed, but
that's about all the value it adds.

Johnny

Re: C limitations, was: Re: VMS process communication

<u1gtqs$2iceg$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27596&group=comp.os.vms#27596

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Sun, 16 Apr 2023 09:39:40 -0400
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <u1gtqs$2iceg$1@dont-email.me>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<u16fvo$32arb$1@dont-email.me> <u16g44$32arb$2@dont-email.me>
<u17m5s$etu$1@news.misty.com> <u18rqh$eb71$1@dont-email.me>
<u1gnnv$g56$1@news.misty.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 16 Apr 2023 13:39:41 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="910fd9bec9018e31126ba3e15947f559";
logging-data="2699728"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qzdBVy+7IjaTb/QC8C24WzDkk3DG10ik="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.10.0
Cancel-Lock: sha1:VdHrGtI5w4cwAGBz4U6qSmg7yNs=
In-Reply-To: <u1gnnv$g56$1@news.misty.com>
Content-Language: en-US
 by: Arne Vajhøj - Sun, 16 Apr 2023 13:39 UTC

On 4/16/2023 7:55 AM, Johnny Billquist wrote:
> On 2023-04-13 14:16, Simon Clubley wrote:
>> On 2023-04-12, Johnny Billquist <bqt@softjar.se> wrote:
>>>
>>> but I'd say that is less common, and a bad programmer will always manage
>>> to write bad code, no matter what language. That don't mean the language
>>> is bad. It is just more unclear, and in C there is no performance
>>> reason, or anything else giving any reason why you would write 48, when
>>> '0' is so much clearer what the intent is. And then it also works if you
>>> use another character set, as long as all the digits have consecutive
>>> code points.
>>>
>>
>> I wonder how the EDCDIC people handle this and your other examples ? :-)
>>
>> (A-Z is not a contiguous unbroken sequence in EBCDIC.)
>
> I know. EBCDIC was despised by most back in the 80s for a reason...
> Anyway, my examples were dealing with digits, which do have the property
> of being a contiguous unbroken sequence even in EBCDIC...
>
> But in general, EBCDIC will require that people do much more coding that
> is very character set aware for some problems. Miserable in general.

There are two types of issues:
* issues due to developer not knowing EBCDIC well enough
* issues due to nature of EBCDIC

The first is a very general phenomenon.

The second cover issues like a-z and A-Z not being
consecutive.

But there are also positives.

The conversion of numbers between EBCDIC text and
zoned BCD is damn fast!

:-)

Arne

Re: C limitations, was: Re: VMS process communication

<u1hb3t$2kdmo$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27613&group=comp.os.vms#27613

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Sun, 16 Apr 2023 13:26:22 -0400
Organization: A noiseless patient Spider
Lines: 101
Message-ID: <u1hb3t$2kdmo$1@dont-email.me>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<u16fvo$32arb$1@dont-email.me> <u16g44$32arb$2@dont-email.me>
<u17m5s$etu$1@news.misty.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 16 Apr 2023 17:26:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="910fd9bec9018e31126ba3e15947f559";
logging-data="2766552"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cZVwNlp6p27aAGuU6h8hVb7b+rS7v1ms="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.10.0
Cancel-Lock: sha1:5P/ykW9qGTDDBw5mtX0jWsGr6go=
In-Reply-To: <u17m5s$etu$1@news.misty.com>
Content-Language: en-US
 by: Arne Vajhøj - Sun, 16 Apr 2023 17:26 UTC

On 4/12/2023 9:33 PM, Johnny Billquist wrote:
> On 2023-04-12 16:44, Arne Vajhøj wrote:
>> On 4/12/2023 10:41 AM, Arne Vajhøj wrote:
>>> On 4/7/2023 4:58 PM, Johnny Billquist wrote:
>>>> On 2023-04-03 14:31, bill wrote:
>>>>> On 4/2/2023 8:50 PM, Johnny Billquist wrote:
>>>>>> On 2023-03-29 19:51, bill wrote:
>>>>>>> Weird?  What about under Primos where chars always have the high
>>>>>>> order
>>>>>>> bit turned on?  It was called "mark memory parity" but it never
>>>>>>> made any
>>>>>>> sense to me when I had to work with it.  :-)
>>>>>>
>>>>>> I think/suspect that this goes outside the scope of C...
>>>>>
>>>>> Of course it does.  But it affects C a lot more than other languages
>>>>> if for no other reason than programming style.  How many Unix C
>>>>> programs
>>>>> have you seen where parsing is done by looking at the value of a
>>>>> letter
>>>>> as opposed to just comparing chars?  Even with Primix porting a Unix
>>>>> program to a Pr1me was a serious task and often not even possible.
>>>>
>>>> I don't understand what you mean. Are you just talking about some
>>>> people assuming you have ASCII, and looking at the decimal values,
>>>> instead of the character representation. Basically writing 65
>>>> instead of 'A'?
>>>> If so, that is certainly something I've seen in lots of languages,
>>>> and are in fact much more an issue in most other languages that I've
>>>> used, since they do not consider a thing like 'A' to be a numeric
>>>> value. C doing that really helps in this context.
>>>>
>>>> I'd say it's more common to see C code using the characters instead
>>>> of their numeric representation just because it is so easy to do in C.
>>>
>>> I believe there are basically two groups of languages:
>>>
>>> A) those where one can write both c=='A' and c==65
>>> B) those where one can write c=='A' but c==65 gives a compile error
>>> and has to be written as ord(c)==65
>>>
>>> I find it more likely that group A will use 65 than group B.
>>
>> Examples of code:
>
> [...lots of code deleted...]
>
> The problem with this is that it is very artificial, and designed to
> prove your point.

Testing if a char is in the digit range is not an artificial problem.

Yes - the example was showing my point - it would have
been pretty weird if I had produced an example that did
not show my point.

> I can just as well give a counter example.
>
> Let's say you have a character that you know is a digit, and you want to
> convert it nicely to an integer.
>
> In C, you'd do that like this:
>
>    x = c - '0';
>
> In FORTRAN, BASIC, and god knows what else, you'd see:
>
>   x = ord(c) - 48;
>
> Now, I'd say I've seen plenty more of that than your type of example.
> And I've *never* seen:
>
>   x = ord(c) - ord('0');
>
>
> And yes, of course, you can also in C do:
>
>   x = c - 48;
>
> but I'd say that is less common, and a bad programmer will always manage
> to write bad code, no matter what language. That don't mean the language
> is bad. It is just more unclear, and in C there is no performance
> reason, or anything else giving any reason why you would write 48, when
> '0' is so much clearer what the intent is. And then it also works if you
> use another character set, as long as all the digits have consecutive
> code points.

I suspect that you are correct that x = c - '0' is more common
than x = c - 48 in C and x = ord(c) - ord('0') is less common
than x = ord(c) - 48 in more type safe languages.

But the construct should be very rare overall as most languages
has easy to use and efficient builtin methods for that.

(and no it is not quite the same for checking if in digit range
as doing conversion and check for error and regex are a bit
heavy tools for the task).

Arne

Re: C limitations, was: Re: VMS process communication

<u1hbgh$2kdmo$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27615&group=comp.os.vms#27615

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Sun, 16 Apr 2023 13:33:05 -0400
Organization: A noiseless patient Spider
Lines: 434
Message-ID: <u1hbgh$2kdmo$2@dont-email.me>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<u16fvo$32arb$1@dont-email.me> <u16g44$32arb$2@dont-email.me>
<u17m5s$etu$1@news.misty.com> <u1hb3t$2kdmo$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 16 Apr 2023 17:33:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="910fd9bec9018e31126ba3e15947f559";
logging-data="2766552"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tHPYikNnIloq6GhJCEwocaOhsTdn2s1o="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.10.0
Cancel-Lock: sha1:Q37lSNQ8Lsu+CWSU10wBk6zv1ko=
In-Reply-To: <u1hb3t$2kdmo$1@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Sun, 16 Apr 2023 17:33 UTC

On 4/16/2023 1:26 PM, Arne Vajhøj wrote:
> On 4/12/2023 9:33 PM, Johnny Billquist wrote:
>> On 2023-04-12 16:44, Arne Vajhøj wrote:
>>> On 4/12/2023 10:41 AM, Arne Vajhøj wrote:
>>>> On 4/7/2023 4:58 PM, Johnny Billquist wrote:
>>>>> On 2023-04-03 14:31, bill wrote:
>>>>>> On 4/2/2023 8:50 PM, Johnny Billquist wrote:
>>>>>>> On 2023-03-29 19:51, bill wrote:
>>>>>>>> Weird?  What about under Primos where chars always have the high
>>>>>>>> order
>>>>>>>> bit turned on?  It was called "mark memory parity" but it never
>>>>>>>> made any
>>>>>>>> sense to me when I had to work with it.  :-)
>>>>>>>
>>>>>>> I think/suspect that this goes outside the scope of C...
>>>>>>
>>>>>> Of course it does.  But it affects C a lot more than other languages
>>>>>> if for no other reason than programming style.  How many Unix C
>>>>>> programs
>>>>>> have you seen where parsing is done by looking at the value of a
>>>>>> letter
>>>>>> as opposed to just comparing chars?  Even with Primix porting a Unix
>>>>>> program to a Pr1me was a serious task and often not even possible.
>>>>>
>>>>> I don't understand what you mean. Are you just talking about some
>>>>> people assuming you have ASCII, and looking at the decimal values,
>>>>> instead of the character representation. Basically writing 65
>>>>> instead of 'A'?
>>>>> If so, that is certainly something I've seen in lots of languages,
>>>>> and are in fact much more an issue in most other languages that
>>>>> I've used, since they do not consider a thing like 'A' to be a
>>>>> numeric value. C doing that really helps in this context.
>>>>>
>>>>> I'd say it's more common to see C code using the characters instead
>>>>> of their numeric representation just because it is so easy to do in C.
>>>>
>>>> I believe there are basically two groups of languages:
>>>>
>>>> A) those where one can write both c=='A' and c==65
>>>> B) those where one can write c=='A' but c==65 gives a compile error
>>>> and has to be written as ord(c)==65
>>>>
>>>> I find it more likely that group A will use 65 than group B.
>>>
>>> Examples of code:
>>
>> [...lots of code deleted...]
>>
>> The problem with this is that it is very artificial, and designed to
>> prove your point.
>
> Testing if a char is in the digit range is not an artificial problem.
>
> Yes - the example was showing my point - it would have
> been pretty weird if I had produced an example that did
> not show my point.
>
>> I can just as well give a counter example.
>>
>> Let's say you have a character that you know is a digit, and you want
>> to convert it nicely to an integer.
>>
>> In C, you'd do that like this:
>>
>>     x = c - '0';
>>
>> In FORTRAN, BASIC, and god knows what else, you'd see:
>>
>>    x = ord(c) - 48;
>>
>> Now, I'd say I've seen plenty more of that than your type of example.
>> And I've *never* seen:
>>
>>    x = ord(c) - ord('0');
>>
>>
>> And yes, of course, you can also in C do:
>>
>>    x = c - 48;
>>
>> but I'd say that is less common, and a bad programmer will always
>> manage to write bad code, no matter what language. That don't mean the
>> language is bad. It is just more unclear, and in C there is no
>> performance reason, or anything else giving any reason why you would
>> write 48, when '0' is so much clearer what the intent is. And then it
>> also works if you use another character set, as long as all the digits
>> have consecutive code points.
>
> I suspect that you are correct that x = c - '0' is more common
> than x = c - 48 in C and x = ord(c) - ord('0') is less common
> than x = ord(c) - 48 in more type safe languages.
>
> But the construct should be very rare overall as most languages
> has easy to use and efficient builtin methods for that.
>
> (and no it is not quite the same for checking if in digit range
> as doing conversion and check for error and regex are a bit
> heavy tools for the task).

And the usual code example to illustrate what I am talking
about.

$ type toint.c
#include <stdio.h>
#include <string.h>

int toint(const char *s)
{ int res;
sscanf(s, "%d", &res);
return res;
}

int tointx(const char *s)
{ int res, i;
res = 0;
for(i = 0; i < strlen(s); i++)
{
res = 10 * res + (s[i] - '0');
}
return res;
}

int tointxx(const char *s)
{ int res, i;
res = 0;
for(i = 0; i < strlen(s); i++)
{
res = 10 * res + (s[i] - 48);
}
return res;
}

void test(const char *s)
{ printf("\"%s\" : %d\n", s, toint(s));
printf("\"%s\" : %d\n", s, tointx(s));
printf("\"%s\" : %d\n", s, tointxx(s));
}

int main(int argc, char *argv[])
{ test("1");
test("12");
test("123");
return 0;
} $ cc toint
$ link toint
$ run toint
"1" : 1
"1" : 1
"1" : 1
"12" : 12
"12" : 12
"12" : 12
"123" : 123
"123" : 123
"123" : 123
$ type toint.pas
program main(input,output);

type
string = varying [255] of char;

function toint(s : string) : integer;

var
res : integer;

begin
readv(s, res);
toint := res;
end;

function tointx(s : string) : integer;

var
res, i : integer;

begin
res := 0;
for i := 1 to length(s) do begin
res := 10 * res + (ord(s[i]) - ord('0'));
end;
tointx := res;
end;

function tointxx(s : string) : integer;

var
res, i : integer;

begin
res := 0;
for i := 1 to length(s) do begin
res := 10 * res + (ord(s[i]) - 48);
end;
tointxx := res;
end;

procedure test(s : string);

begin
writeln('"', s, '" : ', toint(s):1);
writeln('"', s, '" : ', tointx(s):1);
writeln('"', s, '" : ', tointxx(s):1);
end;

begin
test('1');
test('12');
test('123');
end.
$ pas toint
$ link toint
$ run toint
"1" : 1
"1" : 1
"1" : 1
"12" : 12
"12" : 12
"12" : 12
"123" : 123
"123" : 123
"123" : 123
$ type toint.for
program main
call test('1')
call test('12')
call test('123')
end
c subroutine test(s)
character*(*) s
integer*4 toint, tointx, tointxx
write(*,'(1x,a,3h : ,i3)') s, toint(s)
write(*,'(1x,a,3h : ,i3)') s, tointx(s)
write(*,'(1x,a,3h : ,i3)') s, tointxx(s)
end
c integer*4 function toint(s)
character*(*) s
integer*4 res
read(s,'(i)') res
toint = res
end
c integer*4 function tointx(s)
character*(*) s
integer*4 res, i
res = 0
do 100 i = 1, len(s)
res = 10 * res + (ichar(s(i:i)) - ichar('0'))
100 continue
tointx = res
end
c integer*4 function tointxx(s)
character*(*) s
integer*4 res, i
res = 0
do 100 i = 1, len(s)
res = 10 * res + (ichar(s(i:i)) - 48)
100 continue
tointxx = res
end
$ for toint
$ link toint
$ run toint
1 : 1
1 : 1
1 : 1
12 : 12
12 : 12
12 : 12
123 : 123
123 : 123
123 : 123
$ type toint.bas
program main

external sub test(string)

call test("1")
call test("12")
call test("123")

end program
! sub test(string s)

external integer function toint(string)
external integer function tointx(string)
external integer function tointxx(string)


Click here to read the complete article
Re: C limitations, was: Re: VMS process communication

<u1r0rs$dei$1@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27670&group=comp.os.vms#27670

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.80-218-16-84.dclient.hispeed.ch!not-for-mail
From: bqt...@softjar.se (Johnny Billquist)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Thu, 20 Apr 2023 11:32:43 +0200
Organization: MGT Consulting
Message-ID: <u1r0rs$dei$1@news.misty.com>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<u16fvo$32arb$1@dont-email.me> <u16g44$32arb$2@dont-email.me>
<u17m5s$etu$1@news.misty.com> <u1hb3t$2kdmo$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 20 Apr 2023 09:32:44 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="80-218-16-84.dclient.hispeed.ch:80.218.16.84";
logging-data="13778"; mail-complaints-to="abuse@misty.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.10.0
Content-Language: en-US
In-Reply-To: <u1hb3t$2kdmo$1@dont-email.me>
 by: Johnny Billquist - Thu, 20 Apr 2023 09:32 UTC

On 2023-04-16 19:26, Arne Vajhøj wrote:
> On 4/12/2023 9:33 PM, Johnny Billquist wrote:
>> On 2023-04-12 16:44, Arne Vajhøj wrote:
>>> On 4/12/2023 10:41 AM, Arne Vajhøj wrote:
>>>> On 4/7/2023 4:58 PM, Johnny Billquist wrote:
>>>>> On 2023-04-03 14:31, bill wrote:
>>>>>> On 4/2/2023 8:50 PM, Johnny Billquist wrote:
>>>>>>> On 2023-03-29 19:51, bill wrote:
>>>>>>>> Weird?  What about under Primos where chars always have the high
>>>>>>>> order
>>>>>>>> bit turned on?  It was called "mark memory parity" but it never
>>>>>>>> made any
>>>>>>>> sense to me when I had to work with it.  :-)
>>>>>>>
>>>>>>> I think/suspect that this goes outside the scope of C...
>>>>>>
>>>>>> Of course it does.  But it affects C a lot more than other languages
>>>>>> if for no other reason than programming style.  How many Unix C
>>>>>> programs
>>>>>> have you seen where parsing is done by looking at the value of a
>>>>>> letter
>>>>>> as opposed to just comparing chars?  Even with Primix porting a Unix
>>>>>> program to a Pr1me was a serious task and often not even possible.
>>>>>
>>>>> I don't understand what you mean. Are you just talking about some
>>>>> people assuming you have ASCII, and looking at the decimal values,
>>>>> instead of the character representation. Basically writing 65
>>>>> instead of 'A'?
>>>>> If so, that is certainly something I've seen in lots of languages,
>>>>> and are in fact much more an issue in most other languages that
>>>>> I've used, since they do not consider a thing like 'A' to be a
>>>>> numeric value. C doing that really helps in this context.
>>>>>
>>>>> I'd say it's more common to see C code using the characters instead
>>>>> of their numeric representation just because it is so easy to do in C.
>>>>
>>>> I believe there are basically two groups of languages:
>>>>
>>>> A) those where one can write both c=='A' and c==65
>>>> B) those where one can write c=='A' but c==65 gives a compile error
>>>> and has to be written as ord(c)==65
>>>>
>>>> I find it more likely that group A will use 65 than group B.
>>>
>>> Examples of code:
>>
>> [...lots of code deleted...]
>>
>> The problem with this is that it is very artificial, and designed to
>> prove your point.
>
> Testing if a char is in the digit range is not an artificial problem.
>
> Yes - the example was showing my point - it would have
> been pretty weird if I had produced an example that did
> not show my point.

The problem is that it is very artificial.
First of all, I've never seen C code where people would write

if ((x < 48) || (57 < x)) { ... }

It's just plain stupid to write that if they want to check if it is a
digit. It's close to unreadable, and just makes much more sense to say
'0' and '9'.

But secondly, noone in C would/should ever even do such a stupid thing.
There are isdigit() for exactly this, and basically any other
categorization you would want to do, so even more so, the suggested bad
way of doing it in C is not something anyone would/should do.

And using a function like isdigit() is actually way better than checking
if the character is between '0' and '9', even in other languages. Since
it actually also removes the possible risks that you might have a
character set where they are not consecutive values. Your code is
already making bad assumptions, and in most languages you are actually
force to stick with those assumptions.

In C, you are not, and should actually not write this kind of code. It
is potentially bad and non-portable in all kind of weird ways.

That is why you have libraries that provide the proper evaluation of
such issues, and which makes the code safer.

So in the end, I definitely think C does this better than your other
languages selected.

(And yes, my silly example of converting a character to a binary value
also suffers from the potential bad non-portability which was pointed
out. But I was just trying to find an example where expressing integer
values as characters actually was helpful, and not bad. Probably should
try to think of other examples, if we really want to continue this...)

Johnny

Re: C limitations, was: Re: VMS process communication

<u21rmt$3fikq$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27700&group=comp.os.vms#27700

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Sat, 22 Apr 2023 19:47:38 -0400
Organization: A noiseless patient Spider
Lines: 102
Message-ID: <u21rmt$3fikq$1@dont-email.me>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<u16fvo$32arb$1@dont-email.me> <u16g44$32arb$2@dont-email.me>
<u17m5s$etu$1@news.misty.com> <u1hb3t$2kdmo$1@dont-email.me>
<u1r0rs$dei$1@news.misty.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 22 Apr 2023 23:47:41 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a1563055826bf7ef3fc23e727698888e";
logging-data="3656346"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Vubmqsd7ss1A4CSoxjLGdhcK/Gb9domc="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.10.0
Cancel-Lock: sha1:bkc181LmElfdHhMzEpFQMnTVVyI=
Content-Language: en-US
In-Reply-To: <u1r0rs$dei$1@news.misty.com>
 by: Arne Vajhøj - Sat, 22 Apr 2023 23:47 UTC

On 4/20/2023 5:32 AM, Johnny Billquist wrote:
> On 2023-04-16 19:26, Arne Vajhøj wrote:
>> On 4/12/2023 9:33 PM, Johnny Billquist wrote:
>>> On 2023-04-12 16:44, Arne Vajhøj wrote:
>>>> On 4/12/2023 10:41 AM, Arne Vajhøj wrote:
>>>>> On 4/7/2023 4:58 PM, Johnny Billquist wrote:
>>>>>> On 2023-04-03 14:31, bill wrote:
>>>>>>> On 4/2/2023 8:50 PM, Johnny Billquist wrote:
>>>>>>>> On 2023-03-29 19:51, bill wrote:
>>>>>>>>> Weird?  What about under Primos where chars always have the
>>>>>>>>> high order
>>>>>>>>> bit turned on?  It was called "mark memory parity" but it never
>>>>>>>>> made any
>>>>>>>>> sense to me when I had to work with it.  :-)
>>>>>>>>
>>>>>>>> I think/suspect that this goes outside the scope of C...
>>>>>>>
>>>>>>> Of course it does.  But it affects C a lot more than other languages
>>>>>>> if for no other reason than programming style.  How many Unix C
>>>>>>> programs
>>>>>>> have you seen where parsing is done by looking at the value of a
>>>>>>> letter
>>>>>>> as opposed to just comparing chars?  Even with Primix porting a Unix
>>>>>>> program to a Pr1me was a serious task and often not even possible.
>>>>>>
>>>>>> I don't understand what you mean. Are you just talking about some
>>>>>> people assuming you have ASCII, and looking at the decimal values,
>>>>>> instead of the character representation. Basically writing 65
>>>>>> instead of 'A'?
>>>>>> If so, that is certainly something I've seen in lots of languages,
>>>>>> and are in fact much more an issue in most other languages that
>>>>>> I've used, since they do not consider a thing like 'A' to be a
>>>>>> numeric value. C doing that really helps in this context.
>>>>>>
>>>>>> I'd say it's more common to see C code using the characters
>>>>>> instead of their numeric representation just because it is so easy
>>>>>> to do in C.
>>>>>
>>>>> I believe there are basically two groups of languages:
>>>>>
>>>>> A) those where one can write both c=='A' and c==65
>>>>> B) those where one can write c=='A' but c==65 gives a compile error
>>>>> and has to be written as ord(c)==65
>>>>>
>>>>> I find it more likely that group A will use 65 than group B.
>>>>
>>>> Examples of code:
>>>
>>> [...lots of code deleted...]
>>>
>>> The problem with this is that it is very artificial, and designed to
>>> prove your point.
>>
>> Testing if a char is in the digit range is not an artificial problem.
>>
>> Yes - the example was showing my point - it would have
>> been pretty weird if I had produced an example that did
>> not show my point.
>
> The problem is that it is very artificial.
> First of all, I've never seen C code where people would write
>
> if ((x < 48) || (57 < x)) { ... }
>
> It's just plain stupid to write that if they want to check if it is a
> digit. It's close to unreadable, and just makes much more sense to say
> '0' and '9'.
>
> But secondly, noone in C would/should ever even do such a stupid thing.
> There are isdigit() for exactly this, and basically any other
> categorization you would want to do, so even more so, the suggested bad
> way of doing it in C is not something anyone would/should do.
>
> And using a function like isdigit() is actually way better than checking
> if the character is between '0' and '9', even in other languages. Since
> it actually also removes the possible risks that you might have a
> character set where they are not consecutive values. Your code is
> already making bad assumptions, and in most languages you are actually
> force to stick with those assumptions.
>
> In C, you are not, and should actually not write this kind of code. It
> is potentially bad and non-portable in all kind of weird ways.
>
> That is why you have libraries that provide the proper evaluation of
> such issues, and which makes the code safer.
>
> So in the end, I definitely think C does this better than your other
> languages selected.

True. In C the isdigit function would be much better than a range check.

Some other languages have similar functions, but not necessarily
doing what the programmer want.

Java has a Character.isDigit method that return true for 350 chars.
But I am pretty sure that most Java developers are interested in
knowing if the char is in 0..9 not whether it is among those 350 chars.

Arne

Re: C limitations, was: Re: VMS process communication

<u21sd5$3fpii$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=27701&group=comp.os.vms#27701

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: C limitations, was: Re: VMS process communication
Date: Sat, 22 Apr 2023 19:59:30 -0400
Organization: A noiseless patient Spider
Lines: 110
Message-ID: <u21sd5$3fpii$1@dont-email.me>
References: <631fb9a1$0$703$14726298@news.sunsite.dk>
<tvf4j6$lpst$1@dont-email.me> <k88rd6FmhttU1@mid.individual.net>
<tvnffo$shi$1@panix2.panix.com> <tvs23c$37d4e$1@dont-email.me>
<tvt4jf$b82$1@news.misty.com>
<4b19ca379d935295930f6fb5ea59f983d617f2bd.camel@munted.eu>
<tvulqg$3o71m$1@dont-email.me> <u01m8k$scd$4@news.misty.com>
<k8jc4aFmhtrU2@mid.individual.net> <u0d7ss$v7b$1@news.misty.com>
<k8vv8cFtencU2@mid.individual.net> <u0q05f$f44$1@news.misty.com>
<u16fvo$32arb$1@dont-email.me> <u16g44$32arb$2@dont-email.me>
<u17m5s$etu$1@news.misty.com> <u1hb3t$2kdmo$1@dont-email.me>
<u1r0rs$dei$1@news.misty.com> <u21rmt$3fikq$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 22 Apr 2023 23:59:33 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a1563055826bf7ef3fc23e727698888e";
logging-data="3663442"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rSDYWjfCGIRodDHw+kQM1hsX9RDjZc5Y="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.10.0
Cancel-Lock: sha1:EDdRpMUDa/Eml0nFZJp+1USbZ7k=
In-Reply-To: <u21rmt$3fikq$1@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Sat, 22 Apr 2023 23:59 UTC

On 4/22/2023 7:47 PM, Arne Vajhøj wrote:
> On 4/20/2023 5:32 AM, Johnny Billquist wrote:
>> On 2023-04-16 19:26, Arne Vajhøj wrote:
>>> On 4/12/2023 9:33 PM, Johnny Billquist wrote:
>>>> On 2023-04-12 16:44, Arne Vajhøj wrote:
>>>>> On 4/12/2023 10:41 AM, Arne Vajhøj wrote:
>>>>>> On 4/7/2023 4:58 PM, Johnny Billquist wrote:
>>>>>>> On 2023-04-03 14:31, bill wrote:
>>>>>>>> On 4/2/2023 8:50 PM, Johnny Billquist wrote:
>>>>>>>>> On 2023-03-29 19:51, bill wrote:
>>>>>>>>>> Weird?  What about under Primos where chars always have the
>>>>>>>>>> high order
>>>>>>>>>> bit turned on?  It was called "mark memory parity" but it
>>>>>>>>>> never made any
>>>>>>>>>> sense to me when I had to work with it.  :-)
>>>>>>>>>
>>>>>>>>> I think/suspect that this goes outside the scope of C...
>>>>>>>>
>>>>>>>> Of course it does.  But it affects C a lot more than other
>>>>>>>> languages
>>>>>>>> if for no other reason than programming style.  How many Unix C
>>>>>>>> programs
>>>>>>>> have you seen where parsing is done by looking at the value of a
>>>>>>>> letter
>>>>>>>> as opposed to just comparing chars?  Even with Primix porting a
>>>>>>>> Unix
>>>>>>>> program to a Pr1me was a serious task and often not even possible.
>>>>>>>
>>>>>>> I don't understand what you mean. Are you just talking about some
>>>>>>> people assuming you have ASCII, and looking at the decimal
>>>>>>> values, instead of the character representation. Basically
>>>>>>> writing 65 instead of 'A'?
>>>>>>> If so, that is certainly something I've seen in lots of
>>>>>>> languages, and are in fact much more an issue in most other
>>>>>>> languages that I've used, since they do not consider a thing like
>>>>>>> 'A' to be a numeric value. C doing that really helps in this
>>>>>>> context.
>>>>>>>
>>>>>>> I'd say it's more common to see C code using the characters
>>>>>>> instead of their numeric representation just because it is so
>>>>>>> easy to do in C.
>>>>>>
>>>>>> I believe there are basically two groups of languages:
>>>>>>
>>>>>> A) those where one can write both c=='A' and c==65
>>>>>> B) those where one can write c=='A' but c==65 gives a compile
>>>>>> error and has to be written as ord(c)==65
>>>>>>
>>>>>> I find it more likely that group A will use 65 than group B.
>>>>>
>>>>> Examples of code:
>>>>
>>>> [...lots of code deleted...]
>>>>
>>>> The problem with this is that it is very artificial, and designed to
>>>> prove your point.
>>>
>>> Testing if a char is in the digit range is not an artificial problem.
>>>
>>> Yes - the example was showing my point - it would have
>>> been pretty weird if I had produced an example that did
>>> not show my point.
>>
>> The problem is that it is very artificial.
>> First of all, I've never seen C code where people would write
>>
>> if ((x < 48) || (57 < x)) { ... }
>>
>> It's just plain stupid to write that if they want to check if it is a
>> digit. It's close to unreadable, and just makes much more sense to say
>> '0' and '9'.
>>
>> But secondly, noone in C would/should ever even do such a stupid
>> thing. There are isdigit() for exactly this, and basically any other
>> categorization you would want to do, so even more so, the suggested
>> bad way of doing it in C is not something anyone would/should do.
>>
>> And using a function like isdigit() is actually way better than
>> checking if the character is between '0' and '9', even in other
>> languages. Since it actually also removes the possible risks that you
>> might have a character set where they are not consecutive values. Your
>> code is already making bad assumptions, and in most languages you are
>> actually force to stick with those assumptions.
>>
>> In C, you are not, and should actually not write this kind of code. It
>> is potentially bad and non-portable in all kind of weird ways.
>>
>> That is why you have libraries that provide the proper evaluation of
>> such issues, and which makes the code safer.
>>
>> So in the end, I definitely think C does this better than your other
>> languages selected.
>
> True. In C the isdigit function would be much better than a range check.
>
> Some other languages have similar functions, but not necessarily
> doing what the programmer want.
>
> Java has a Character.isDigit method that return true for 350 chars.
> But I am pretty sure that most Java developers are interested in
> knowing if the char is in 0..9 not whether it is among those 350 chars.

Of course C also got iswdigit - which on my system return true
for 263 input values.

But I don't think w is that popular in C.

Arne


computers / comp.os.vms / Re: VMS process communication

Pages:123456789
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor