Sujet : Re: Back & Forth - Co-routines
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forthDate : 01. Feb 2025, 01:31:39
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <b4cce50a96837965e8bce845b89a39764dca0ef6@i2pn2.org>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 1/02/2025 2:25 am, Hans Bezemer wrote:
...
I'm sure it works - but IMHO it heavily depends on whether those words are primitives or not. E.g. in 4tH this expends to:
: local r> rot rot dup @ over >r >r ! ;: r> r> ! ;
And if I want to be pedantic, I have to include two SWAPs as well for the proper definition of 2>R and 2R>
Of course but for most forths it should be fine.
- not to mention that you sometimes *DON'T* want to initialize your locals.
Well, now we're talking about something that's not the norm for locals and
that may be worth a discussion.
Another (consequential) disadvantage of this definition is that you have to *DEFINE* your words in reverse - a drawback which it shares with the original ANS LOCALS wordset.
Drawback for those wanting locals that fake a stack comment. IIRC iForth has
LOCAL so clearly not everyone is fussed. If I use locals I'm more likely to
use the ANS notation. I notice Forth Inc does too - perhaps why they were so
adverse to conceding to { } .