Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

The meek shall inherit the earth; the rest of us will go to the stars.


devel / comp.theory / Unusual Programming Question Regarding FOR Loops

SubjectAuthor
* Unusual Programming Question Regarding FOR LoopsCharlie-Boo
`- Unusual Programming Question Regarding FOR LoopsRichard Damon

1
Unusual Programming Question Regarding FOR Loops

<e1399ccd-1681-4c17-9c0f-723563c6291en@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=48749&group=comp.theory#48749

  copy link   Newsgroups: comp.theory
X-Received: by 2002:a05:622a:118f:b0:40f:2462:a356 with SMTP id m15-20020a05622a118f00b0040f2462a356mr76677qtk.12.1691855732726;
Sat, 12 Aug 2023 08:55:32 -0700 (PDT)
X-Received: by 2002:a63:b34b:0:b0:564:9785:75c with SMTP id
x11-20020a63b34b000000b005649785075cmr1068819pgt.10.1691855732147; Sat, 12
Aug 2023 08:55:32 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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.theory
Date: Sat, 12 Aug 2023 08:55:31 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2601:184:407f:110:14eb:a03a:547c:5865;
posting-account=UA-6fQkAAADI18fSPOc495gPgW1akxLl
NNTP-Posting-Host: 2601:184:407f:110:14eb:a03a:547c:5865
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e1399ccd-1681-4c17-9c0f-723563c6291en@googlegroups.com>
Subject: Unusual Programming Question Regarding FOR Loops
From: shymathguy@gmail.com (Charlie-Boo)
Injection-Date: Sat, 12 Aug 2023 15:55:32 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1555
 by: Charlie-Boo - Sat, 12 Aug 2023 15:55 UTC

In a programming language with no GOTOs (although they can be simulated), if a FOR loop, upon completing its iterations, then transfers to an earlier FOR loop in the same program, does it always transfer to the INCREMENT (not the first iteration) of that earlier FOR, or could it transfer to the INITIALIZE (the first iteration) of that earlier FOR?

I am writing a PHP interpreter in PHP and thought the answer is yes, but am not so sure now.

C-B

Re: Unusual Programming Question Regarding FOR Loops

<J5OBM.586698$TPw2.528002@fx17.iad>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=48751&group=comp.theory#48751

  copy link   Newsgroups: comp.theory
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx17.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Unusual Programming Question Regarding FOR Loops
Content-Language: en-US
Newsgroups: comp.theory
References: <e1399ccd-1681-4c17-9c0f-723563c6291en@googlegroups.com>
From: Richard@Damon-Family.org (Richard Damon)
In-Reply-To: <e1399ccd-1681-4c17-9c0f-723563c6291en@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 17
Message-ID: <J5OBM.586698$TPw2.528002@fx17.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Sat, 12 Aug 2023 12:06:00 -0400
X-Received-Bytes: 1907
 by: Richard Damon - Sat, 12 Aug 2023 16:06 UTC

On 8/12/23 11:55 AM, Charlie-Boo wrote:
> In a programming language with no GOTOs (although they can be simulated), if a FOR loop, upon completing its iterations, then transfers to an earlier FOR loop in the same program, does it always transfer to the INCREMENT (not the first iteration) of that earlier FOR, or could it transfer to the INITIALIZE (the first iteration) of that earlier FOR?
>
> I am writing a PHP interpreter in PHP and thought the answer is yes, but am not so sure now.
>
> C-B

The inner "for" loop, when it completes, will fall-through to the its
end, which will eventually (or maybe immediately) reach the end of the
body of the outer "for" loop, which will cause its iteration (increment)
clause to execute.

The "initialization" clause is only run on entering the for loop from
outside of it, never as a result of the loop running.

Note, the INNER "for" loop will perform its initialization clause every
time it is entered from the running of the outer "for" loop.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor