Re: "Back & Forth" - Local variables

Liste des GroupesRevenir à cl forth 
Sujet : Re: "Back & Forth" - Local variables
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forth
Date : 10. Jan 2025, 00:54:42
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <7f4d1c07f94e604c28d4f13ee6b7ecbe8138c28d@i2pn2.org>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla Thunderbird
On 10/01/2025 3:15 am, Hans Bezemer wrote:
On 09-01-2025 13:42, dxf wrote:
There is no guarantee that a saved interpreter pointer on the
stack is an execution token.

Albert said that.  He's referring to the use of EXECUTE.  What surprised me
is half the forths on my desktop worked (though not DX-Forth).

 
Nope - in ANS-Forth it is listed as:
 
nest-sys; definition calls; implementation dependent
 
So - that's obvious. But in 4tH it works out. And defining it as >R works out as well. BTW, I've tested the thing - and it holds up.
 
I got my work cut out for a next episode! On co-routines! ;-)

Great.  While I've seen co-routines mentioned, examples were rare so I
tended to ignore it.

 
Hans Bezemer
 
BTW, I've heard there are implementations where nest-sys aren't even on the return stack. The standard seems to confirm this:
 
return stack:  A stack that _MAY_BE_ used for program execution nesting, do-loop execution, temporary storage, and other purposes.
 
.. and sorry to spoil the fun, but what we're doing here is illegal anyways:
 
"A program shall _NOT_ access values on the return stack (using R@, R>, 2R@ or 2R>) that it _DID_NOT_ place there using >R or 2>R;"
 
In other words: your mileage may (be) very, very illegal.

The >R dependency is on what was (and perhaps still is) 'common practice'.
I was unsure how it would fare but all the popular forths seem to work.
If ANS-FORTH has issued one too many 'Thou shalt not's and in doing so has
excluded itself then that's too bad.


Date Sujet#  Auteur
8 Jan 25 * "Back & Forth" - Local variables39Hans Bezemer
8 Jan 25 +- Re: "Back & Forth" - Local variables1dxf
8 Jan 25 `* Re: "Back & Forth" - Local variables37albert
8 Jan 25  +* Re: "Back & Forth" - Local variables21Hans Bezemer
8 Jan 25  i`* Re: "Back & Forth" - Local variables20albert
8 Jan 25  i +* Re: "Back & Forth" - Local variables2mhx
9 Jan 25  i i`- Re: "Back & Forth" - Local variables1albert
11 Mar 25  i `* Re: "Back & Forth" - Local variables17dxf
11 Mar 25  i  +- Re: "Back & Forth" - Local variables1dxf
11 Mar 25  i  +* Re: "Back & Forth" - Local variables4Hans Bezemer
12 Mar 25  i  i`* Re: "Back & Forth" - Local variables3dxf
12 Mar 25  i  i +- Re: "Back & Forth" - Local variables1albert
13 Mar 25  i  i `- Re: "Back & Forth" - Local variables1dxf
12 Mar 25  i  `* Re: "Back & Forth" - Local variables11dxf
13 Mar 25  i   `* Re: "Back & Forth" - Local variables10sjack
14 Mar 25  i    `* Re: "Back & Forth" - Local variables9dxf
14 Mar 25  i     +* Re: "Back & Forth" - Local variables2sjack
14 Mar 25  i     i`- Re: "Back & Forth" - Local variables1sjack
16 Mar 25  i     `* Re: "Back & Forth" - Local variables6Hans Bezemer
16 Mar 25  i      `* Re: "Back & Forth" - Local variables5sjack
16 Mar 25  i       +- Re: "Back & Forth" - Local variables1sjack
17 Mar 25  i       +- Re: "Back & Forth" - Local variables1sjack
17 Mar 25  i       `* Re: "Back & Forth" - Local variables2sjack
18 Mar 25  i        `- Re: "Back & Forth" - Local variables1dxf
8 Jan 25  +* Re: "Back & Forth" - Local variables13Hans Bezemer
8 Jan 25  i`* Re: "Back & Forth" - Local variables12dxf
9 Jan 25  i `* Re: "Back & Forth" - Local variables11dxf
9 Jan 25  i  +* Re: "Back & Forth" - Local variables9albert
9 Jan 25  i  i+* Re: "Back & Forth" - Local variables7dxf
9 Jan 25  i  ii`* Re: "Back & Forth" - Local variables6Hans Bezemer
10 Jan 25  i  ii +* Re: "Back & Forth" - Local variables4dxf
10 Jan 25  i  ii i+- Re: "Back & Forth" - Local variables1Hans Bezemer
10 Jan 25  i  ii i`* Re: "Back & Forth" - Local variables2sjack
10 Jan 25  i  ii i `- Re: "Back & Forth" - Local variables1dxf
10 Jan 25  i  ii `- Re: "Back & Forth" - Local variables1albert
9 Jan 25  i  i`- xts and return addresses (was: "Back & Forth" - Local variables)1Anton Ertl
9 Jan 25  i  `- Re: "Back & Forth" - Local variables1sjack
10 Jan 25  `* Re: "Back & Forth" - Local variables2albert
10 Jan 25   `- Re: "Back & Forth" - Local variables1Hans Bezemer

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal