Deutsch   English   Français   Italiano  
<vr9l6a$ivrn$1@dont-email.me>

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

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: sjack@dontemail.me (sjack)
Newsgroups: comp.lang.forth
Subject: Re: "Back & Forth" - Local variables
Date: Mon, 17 Mar 2025 17:12:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <vr9l6a$ivrn$1@dont-email.me>
References: <nnd$75b7a2a4$616fdd6b@4f60b314ce95c9b9> <nnd$2667ecd9$5346da92@588c31a6934614dc> <nnd$195c1faa$7b482483@cd77336ac20a3e59> <vr7d97$2h8n5$1@dont-email.me> <nnd$69c0cd08$7fca01d0@a6bba47cc24ef259>
Injection-Date: Mon, 17 Mar 2025 18:12:42 +0100 (CET)
Injection-Info: dont-email.me; posting-host="2bae9fabbf13686cb1619bee66f01afb";
	logging-data="622455"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+I0K1xYoY4N4LTsjYAXeUt"
User-Agent: tin/2.6.4-20240224 ("Banff") (Linux/6.8.0-55-generic (x86_64))
Cancel-Lock: sha1:e9GIxF+3mo2Skl4sE5nKMqVuYjs=
Bytes: 2561

albert@spenarnc.xs4all.nl wrote:
>>i. {} --> 1 2 3 4
> No what is that supposed to mean?
> 
Ok, for the record then, Toad test and demo aids:

1) { ... } 
   Set a marker and compile the code within the braces.

2) {} 
   Executes the code compiled by { ... } but doesn't perform the marker,
   therefore {} can execute the code multiple times if so desired.

   The marker can be performed manually by performing {FIN} .
   {FIN} is found in other words such as E or RUN1 (they the same)
   which follow { ... } to do a one-time execution of the marked code.

   Other words execute the code multiple times in a loop and performs 
   {FIN} when done:
    i. RUN
       Loops the code until TRUE is returned
    i. RUNS
       Loops the code n times
    i. GRUN
       Performs RUN and drops g-string that remained on stack
    i. FORALL
       Perform {} on all (counted) strings on the data stack
3) i. 
   Print " --> " .
   It serves as a list item mark and also prints an arrow to indicate
   the output of the words that follow.
   
Summary:

i. { ... } E        \ run once
i. { ... } RUN1     \ ditto, run once
i. { ... } n RUNS   \ run n times
i. { ... } RUN      \ run while returned flag is TRUE
i. { ... } GRUN     \ perform RUN and drop a remaining g-string
i. { ... } FORALL   \ perform {} on each (counted) string on the data stack

Note: g-string is a generic string; it is referenced by address and
      count on the data stack (standard Forth strings are g-strings)

-- 
me