Deutsch   English   Français   Italiano  
<7f4d1c07f94e604c28d4f13ee6b7ecbe8138c28d@i2pn2.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: dxf <dxforth@gmail.com>
Newsgroups: comp.lang.forth
Subject: Re: "Back & Forth" - Local variables
Date: Fri, 10 Jan 2025 10:54:42 +1100
Organization: i2pn2 (i2pn.org)
Message-ID: <7f4d1c07f94e604c28d4f13ee6b7ecbe8138c28d@i2pn2.org>
References: <nnd$75b7a2a4$616fdd6b@4f60b314ce95c9b9>
 <nnd$65a6d402$1bfbf0ca@d49afc2a32e40cf2>
 <752c8e210166d00119336309dc35240d36d6f17d@i2pn2.org>
 <9747ef2be5ee93d6a4f0c89352a38cec72624609@i2pn2.org>
 <nnd$43da5afe$0d359236@662b3066f040a86b>
 <6a2d3e50f9435ebced9e72d5770af8ff75b6153e@i2pn2.org>
 <nnd$44fc771d$089c856c@db10b46852f85b89>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 9 Jan 2025 23:54:43 -0000 (UTC)
Injection-Info: i2pn2.org;
	logging-data="2849981"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="XPw7UV90Iy7EOhY4YuUXhpdoEf5Vz7K+BsxA/Cx8bVc";
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
X-Spam-Checker-Version: SpamAssassin 4.0.0
In-Reply-To: <nnd$44fc771d$089c856c@db10b46852f85b89>
Bytes: 2771
Lines: 37

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.