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 : 13. Mar 2025, 00:04:17
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <207e91b417e7d59b64b9289a51ca824c6d26bd6d@i2pn2.org>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 12/03/2025 9:29 pm, albert@spenarnc.xs4all.nl wrote:
In article <858080e0b3faa16a4b9ba24e3b34e12a555494b4@i2pn2.org>,
dxf  <dxforth@gmail.com> wrote:
On 12/03/2025 8:14 am, Hans Bezemer wrote:
...
Since the LOCAL definition has already moved the return address to
     the data stack, ;: works.. In an earlier version I moved the return
     address back to the return stack and executed YIELD. Which (of course)
     worked. So they're not that far apart IMHO.
>
But of equal value?  As you say YIELD can be made to do ;:
>
 
This discussion is typical of Forth. A specification of a word
is essential,  then I can implement it.
I quarrel about the meaning of ;: , and you casually mention
"do ;:" as if everybody knows what this is supposed to mean.
 
This is the specification of CO .
Note how the stack effect is ( -- ) .
For most Forthers this is a apparently a sufficient specification.
 
"
   CO
 
  STACKEFFECT:
 
  DESCRIPTION: []
 
  Return to the caller, suspending interpretation of the current
  definition, such that when the caller exits, this definition is
  resumed. The return stack must not be engaged, such as between >R and
  R> , or DO and LOOP .

It seems a digression to formally specify something you previously
commented on and whose implementation worked on all popular forths.
But to borrow yours, the definition would go something like:

   ;:  ( nest-sys -- )
 
   Return to the caller specified by nest-sys, suspending [etc etc]


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