Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The University of California Statistics Department; where mean is normal, and deviation standard.


devel / comp.lang.fortran / Re: “Why do arrays start at 0?"

SubjectAuthor
* “Why do arrays start at 0?"Lynn McGuire
+* “Why do arrays start at 0?"Thomas Koenig
|`- “Why do arrays start at 0?"gah4
+* “Why do arrays start at 0?"gah4
|`- “Why do arrays start at 0?"Robin Vowels
`- “Why do arrays start at 0?"Robin Vowels

1
Re: “Why do arrays start at 0?"

<tegcug$tiu$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!mdf2aNOb2oCHynmZpuX5uw.user.46.165.242.91.POSTED!not-for-mail
From: lynnmcgu...@gmail.com (Lynn McGuire)
Newsgroups: comp.lang.fortran
Subject: Re: “Why do arrays start at 0?"
Date: Sun, 28 Aug 2022 13:42:22 -0500
Organization: Aioe.org NNTP Server
Message-ID: <tegcug$tiu$1@gioia.aioe.org>
References: <tebblf$2gpm$1@dont-email.me>
<2ec469de-b871-4fe7-bafd-9ae32e40a434n@googlegroups.com>
<8a00a39d-e43d-42ee-8620-8090645fc43bn@googlegroups.com>
<22855686-fa84-4d0d-9790-b883cf1244cdn@googlegroups.com>
<teco73$ce2$1@newsreader4.netcologne.de>
<e9ab592e-6c95-4399-918c-3dd5f8a0c3b1n@googlegroups.com>
<tee4th$cqm$2@newsreader4.netcologne.de>
<993d8e78-7cfc-4768-a735-35aff3b5a911n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="30302"; posting-host="mdf2aNOb2oCHynmZpuX5uw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.2.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Lynn McGuire - Sun, 28 Aug 2022 18:42 UTC

On 8/28/2022 12:26 AM, gah4 wrote:
> On Saturday, August 27, 2022 at 3:13:09 PM UTC-7, Thomas Koenig wrote:
>> gah4 <ga...@u.washington.edu> schrieb:
>>> On Saturday, August 27, 2022 at 2:30:15 AM UTC-7, Thomas Koenig wrote:
> (snip)
>>>> Really? You mean that
>
>>>> DO 10 I=0,1
>
>>>> would not be allowed?
>
>>> Yes, not allowed.
>
>> I have the Fortran 66 standard before me, and I find no such
>> restriction in 7.1.2.8 (nor would it make sense at all).
>
>> Which part of the standard are you referring to?
>
> Yes 7.1.2.8.
>
> "At time of execution of the DO statement, m1, m2, and m3 must be greater than zero."

What ? Our code has negative indexes dating back to F66 days. I am
assuming that this is:

DO 10 I = ncp, 1, -1

Lynn

Re: “Why do arrays start at 0?"

<tegigf$vfn$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-4e56-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: “Why do arrays start at 0?"
Date: Sun, 28 Aug 2022 20:17:19 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tegigf$vfn$1@newsreader4.netcologne.de>
References: <tebblf$2gpm$1@dont-email.me>
<2ec469de-b871-4fe7-bafd-9ae32e40a434n@googlegroups.com>
<8a00a39d-e43d-42ee-8620-8090645fc43bn@googlegroups.com>
<22855686-fa84-4d0d-9790-b883cf1244cdn@googlegroups.com>
<teco73$ce2$1@newsreader4.netcologne.de>
<e9ab592e-6c95-4399-918c-3dd5f8a0c3b1n@googlegroups.com>
<tee4th$cqm$2@newsreader4.netcologne.de>
<993d8e78-7cfc-4768-a735-35aff3b5a911n@googlegroups.com>
<tegcug$tiu$1@gioia.aioe.org>
Injection-Date: Sun, 28 Aug 2022 20:17:19 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-4e56-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:4e56:0:7285:c2ff:fe6c:992d";
logging-data="32247"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sun, 28 Aug 2022 20:17 UTC

Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
> On 8/28/2022 12:26 AM, gah4 wrote:
>> On Saturday, August 27, 2022 at 3:13:09 PM UTC-7, Thomas Koenig wrote:
>>> gah4 <ga...@u.washington.edu> schrieb:
>>>> On Saturday, August 27, 2022 at 2:30:15 AM UTC-7, Thomas Koenig wrote:
>> (snip)
>>>>> Really? You mean that
>>
>>>>> DO 10 I=0,1
>>
>>>>> would not be allowed?
>>
>>>> Yes, not allowed.
>>
>>> I have the Fortran 66 standard before me, and I find no such
>>> restriction in 7.1.2.8 (nor would it make sense at all).
>>
>>> Which part of the standard are you referring to?
>>
>> Yes 7.1.2.8.
>>
>> "At time of execution of the DO statement, m1, m2, and m3 must be greater than zero."
>
> What ? Our code has negative indexes dating back to F66 days. I am
> assuming that this is:
>
> DO 10 I = ncp, 1, -1

Hm. Seems like this was carried over from the very first FORTRAN.
The 1956 Programmer's Reference Manual restricted them to unsigned
fixed point constants.

Looking at the Fortran IV language at
http://www.bitsavers.org/pdf/ibm/360/fortran/C28-6515-6_FORTRAN_IV_Language_1966.pdf
we have the same restriction.

So, seems like an extension at the time (a very useful one, too).

Re: “Why do arrays start at 0?"

<a8f49c04-8100-44af-87ff-d52530542f49n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:20a8:b0:477:1882:3e7 with SMTP id 8-20020a05621420a800b00477188203e7mr8317533qvd.44.1661720706852;
Sun, 28 Aug 2022 14:05:06 -0700 (PDT)
X-Received: by 2002:a25:d046:0:b0:695:cef7:4f2c with SMTP id
h67-20020a25d046000000b00695cef74f2cmr6554175ybg.245.1661720706513; Sun, 28
Aug 2022 14:05:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 28 Aug 2022 14:05:06 -0700 (PDT)
In-Reply-To: <tegcug$tiu$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:f529:4607:b78a:d581;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:f529:4607:b78a:d581
References: <tebblf$2gpm$1@dont-email.me> <2ec469de-b871-4fe7-bafd-9ae32e40a434n@googlegroups.com>
<8a00a39d-e43d-42ee-8620-8090645fc43bn@googlegroups.com> <22855686-fa84-4d0d-9790-b883cf1244cdn@googlegroups.com>
<teco73$ce2$1@newsreader4.netcologne.de> <e9ab592e-6c95-4399-918c-3dd5f8a0c3b1n@googlegroups.com>
<tee4th$cqm$2@newsreader4.netcologne.de> <993d8e78-7cfc-4768-a735-35aff3b5a911n@googlegroups.com>
<tegcug$tiu$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a8f49c04-8100-44af-87ff-d52530542f49n@googlegroups.com>
Subject: Re: “Why do arrays start at 0?"
From: gah...@u.washington.edu (gah4)
Injection-Date: Sun, 28 Aug 2022 21:05:06 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2851
 by: gah4 - Sun, 28 Aug 2022 21:05 UTC

On Sunday, August 28, 2022 at 11:42:28 AM UTC-7, Lynn McGuire wrote:
> On 8/28/2022 12:26 AM, gah4 wrote:

(snip, I wrote)

> > "At time of execution of the DO statement, m1, m2, and m3 must be greater than zero."

> What ? Our code has negative indexes dating back to F66 days. I am
> assuming that this is:
> DO 10 I = ncp, 1, -1
Many systems had extensions to Fortran 66, and that might not have been unusual.

Those competing with IBM needed a way to make there systems look better,
and such extensions were one way to do it. DEC had a lot of extensions like that.

On the other hand, IBM was careful with theirs. The had some big extensions
where there was no way around them. END= on READ was very useful!

But DO look changes that were easy to make with a temporary variable
did not get an extension. Making m3 negative means that the test
has to be inverted. IBM Fortran IV compilers don't change the test.

As note, though, IBM Fortran IV compilers will also disallow:

DO 10 I=0,9

though if you use a variable set to 0, it works just fine.
(Unless the optimizer figures it out, and disallows it.)

Similarly,

DO 10 I = ncp, 1, -1

won't compile. If you use a variable set to -1, it will
loop until the variable wraps to a large value.

Re: “Why do arrays start at 0?"

<a46aaa28-82bf-44ca-a2e4-223f27438cd5n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a37:6905:0:b0:6bb:5827:e658 with SMTP id e5-20020a376905000000b006bb5827e658mr6599854qkc.735.1661720921913;
Sun, 28 Aug 2022 14:08:41 -0700 (PDT)
X-Received: by 2002:a81:bb41:0:b0:328:fd1b:5713 with SMTP id
a1-20020a81bb41000000b00328fd1b5713mr7978295ywl.238.1661720921491; Sun, 28
Aug 2022 14:08:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 28 Aug 2022 14:08:41 -0700 (PDT)
In-Reply-To: <tegigf$vfn$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:f529:4607:b78a:d581;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:f529:4607:b78a:d581
References: <tebblf$2gpm$1@dont-email.me> <2ec469de-b871-4fe7-bafd-9ae32e40a434n@googlegroups.com>
<8a00a39d-e43d-42ee-8620-8090645fc43bn@googlegroups.com> <22855686-fa84-4d0d-9790-b883cf1244cdn@googlegroups.com>
<teco73$ce2$1@newsreader4.netcologne.de> <e9ab592e-6c95-4399-918c-3dd5f8a0c3b1n@googlegroups.com>
<tee4th$cqm$2@newsreader4.netcologne.de> <993d8e78-7cfc-4768-a735-35aff3b5a911n@googlegroups.com>
<tegcug$tiu$1@gioia.aioe.org> <tegigf$vfn$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a46aaa28-82bf-44ca-a2e4-223f27438cd5n@googlegroups.com>
Subject: Re: “Why do arrays start at 0?"
From: gah...@u.washington.edu (gah4)
Injection-Date: Sun, 28 Aug 2022 21:08:41 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 23
 by: gah4 - Sun, 28 Aug 2022 21:08 UTC

On Sunday, August 28, 2022 at 1:17:22 PM UTC-7, Thomas Koenig wrote:

(snip)

> Hm. Seems like this was carried over from the very first FORTRAN.
> The 1956 Programmer's Reference Manual restricted them to unsigned
> fixed point constants.
> Looking at the Fortran IV language at
> http://www.bitsavers.org/pdf/ibm/360/fortran/C28-6515-6_FORTRAN_IV_Language_1966.pdf
> we have the same restriction.
> So, seems like an extension at the time (a very useful one, too).

It is not so hard to do with a constant, but IBM didn't do that. It is harder
with a variable, as the test direction depends on the sign.

IBM S/360 compilers use BXLE, Branch on indeX Less than or Equal, to
increment and test, at the end of the loop.

IBM was always good at marking their extensions with gray shading in the
manuals.

Re: “Why do arrays start at 0?"

<154b6b23-0626-4e56-8445-442d1add77een@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:2548:b0:6b6:113d:34fd with SMTP id s8-20020a05620a254800b006b6113d34fdmr6949775qko.132.1661748811513;
Sun, 28 Aug 2022 21:53:31 -0700 (PDT)
X-Received: by 2002:a0d:de83:0:b0:337:c0bf:12ee with SMTP id
h125-20020a0dde83000000b00337c0bf12eemr8193568ywe.289.1661748811322; Sun, 28
Aug 2022 21:53:31 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 28 Aug 2022 21:53:31 -0700 (PDT)
In-Reply-To: <tegcug$tiu$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <tebblf$2gpm$1@dont-email.me> <2ec469de-b871-4fe7-bafd-9ae32e40a434n@googlegroups.com>
<8a00a39d-e43d-42ee-8620-8090645fc43bn@googlegroups.com> <22855686-fa84-4d0d-9790-b883cf1244cdn@googlegroups.com>
<teco73$ce2$1@newsreader4.netcologne.de> <e9ab592e-6c95-4399-918c-3dd5f8a0c3b1n@googlegroups.com>
<tee4th$cqm$2@newsreader4.netcologne.de> <993d8e78-7cfc-4768-a735-35aff3b5a911n@googlegroups.com>
<tegcug$tiu$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <154b6b23-0626-4e56-8445-442d1add77een@googlegroups.com>
Subject: Re: “Why do arrays start at 0?"
From: robin.vo...@gmail.com (Robin Vowels)
Injection-Date: Mon, 29 Aug 2022 04:53:31 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2741
 by: Robin Vowels - Mon, 29 Aug 2022 04:53 UTC

On Monday, August 29, 2022 at 4:42:28 AM UTC+10, Lynn McGuire wrote:
> On 8/28/2022 12:26 AM, gah4 wrote:
> > On Saturday, August 27, 2022 at 3:13:09 PM UTC-7, Thomas Koenig wrote:
> >> gah4 <ga...@u.washington.edu> schrieb:
> >>> On Saturday, August 27, 2022 at 2:30:15 AM UTC-7, Thomas Koenig wrote:
> > (snip)
> >>>> Really? You mean that
> >
> >>>> DO 10 I=0,1
> >
> >>>> would not be allowed?
> >
> >>> Yes, not allowed.
> >
> >> I have the Fortran 66 standard before me, and I find no such
> >> restriction in 7.1.2.8 (nor would it make sense at all).
> >
> >> Which part of the standard are you referring to?
> >
> > Yes 7.1.2.8.
> >
> > "At time of execution of the DO statement, m1, m2, and m3 must be greater than zero."
> What ? Our code has negative indexes dating back to F66 days. I am
> assuming that this is:
>
> DO 10 I = ncp, 1, -1
..
All of these were valid in PL/I from the beginning (1966) --
negative increments, initial values starting at zero or even negative.
..
As well, a PL/I loop could be executed 0 times (inlike FORTRAN
which, at that time, insisted in executing a loop at least once,
even if the initial value was greater than the final value).

Re: “Why do arrays start at 0?"

<7f4d38e8-3adb-42c5-9677-2ea53a97ea59n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ad4:596f:0:b0:484:10b3:4653 with SMTP id eq15-20020ad4596f000000b0048410b34653mr9029596qvb.86.1661748889246;
Sun, 28 Aug 2022 21:54:49 -0700 (PDT)
X-Received: by 2002:a0d:c681:0:b0:33c:2e21:4756 with SMTP id
i123-20020a0dc681000000b0033c2e214756mr8358712ywd.467.1661748889090; Sun, 28
Aug 2022 21:54:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 28 Aug 2022 21:54:48 -0700 (PDT)
In-Reply-To: <a8f49c04-8100-44af-87ff-d52530542f49n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <tebblf$2gpm$1@dont-email.me> <2ec469de-b871-4fe7-bafd-9ae32e40a434n@googlegroups.com>
<8a00a39d-e43d-42ee-8620-8090645fc43bn@googlegroups.com> <22855686-fa84-4d0d-9790-b883cf1244cdn@googlegroups.com>
<teco73$ce2$1@newsreader4.netcologne.de> <e9ab592e-6c95-4399-918c-3dd5f8a0c3b1n@googlegroups.com>
<tee4th$cqm$2@newsreader4.netcologne.de> <993d8e78-7cfc-4768-a735-35aff3b5a911n@googlegroups.com>
<tegcug$tiu$1@gioia.aioe.org> <a8f49c04-8100-44af-87ff-d52530542f49n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7f4d38e8-3adb-42c5-9677-2ea53a97ea59n@googlegroups.com>
Subject: Re: “Why do arrays start at 0?"
From: robin.vo...@gmail.com (Robin Vowels)
Injection-Date: Mon, 29 Aug 2022 04:54:49 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3068
 by: Robin Vowels - Mon, 29 Aug 2022 04:54 UTC

On Monday, August 29, 2022 at 7:05:08 AM UTC+10, gah4 wrote:
> On Sunday, August 28, 2022 at 11:42:28 AM UTC-7, Lynn McGuire wrote:
> > On 8/28/2022 12:26 AM, gah4 wrote:
> (snip, I wrote)
> > > "At time of execution of the DO statement, m1, m2, and m3 must be greater than zero."
>
> > What ? Our code has negative indexes dating back to F66 days. I am
> > assuming that this is:
>
> > DO 10 I = ncp, 1, -1
> Many systems had extensions to Fortran 66, and that might not have been unusual.
>
> Those competing with IBM needed a way to make there systems look better,
> and such extensions were one way to do it. DEC had a lot of extensions like that.
>
> On the other hand, IBM was careful with theirs. The had some big extensions
> where there was no way around them. END= on READ was very useful!
>
> But DO look changes that were easy to make with a temporary variable
> did not get an extension. Making m3 negative means that the test
> has to be inverted. IBM Fortran IV compilers don't change the test.
>
> As note, though, IBM Fortran IV compilers will also disallow:
>
> DO 10 I=0,9
>
> though if you use a variable set to 0, it works just fine.
> (Unless the optimizer figures it out, and disallows it.)
>
> Similarly,
> DO 10 I = ncp, 1, -1
> won't compile. If you use a variable set to -1, it will
> loop until the variable wraps to a large value.
..
You might have to wait a long time for that to happen.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor