Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #55129 > unrolled thread

eForth specific words?

Started byMichael Barry <barrym95838@yahoo.com>
First post2017-02-26 14:20 -0800
Last post2017-03-01 12:16 -0800
Articles 3 on this page of 83 — 14 participants

Back to article view | Back to comp.lang.forth


Contents

  eForth specific words? Michael Barry <barrym95838@yahoo.com> - 2017-02-26 14:20 -0800
    Re: eForth specific words? hughaguilar96@gmail.com - 2017-02-26 17:57 -0800
      Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-02-26 23:15 -0600
      Re: eForth specific words? Michael Barry <barrym95838@yahoo.com> - 2017-02-26 22:04 -0800
        Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-02-27 02:49 -0800
          Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-02-27 11:15 -0600
            Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-02-27 13:10 -0800
              Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-02-27 16:51 -0600
              Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-02-28 22:47 -0600
                Re: eForth specific words? Paul Rubin <no.email@nospam.invalid> - 2017-02-28 21:15 -0800
                  Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-03-01 01:08 -0500
                    Re: eForth specific words? Paul Rubin <no.email@nospam.invalid> - 2017-02-28 23:21 -0800
                  Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-03-01 03:22 -0800
                    Re: eForth specific words? Paul Rubin <no.email@nospam.invalid> - 2017-03-01 13:45 -0800
                      Re: eForth specific words? Paul Rubin <no.email@nospam.invalid> - 2017-03-01 15:42 -0800
                        Re: eForth specific words? Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> - 2017-03-11 14:33 +0000
                        Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-03-11 11:06 -0800
                          Re: eForth specific words? Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> - 2017-03-12 09:58 +0000
                            Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-03-12 03:42 -0700
                      Re: eForth specific words? "HAA" <someone@microsoft.com> - 2017-03-02 15:37 +1100
                        Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-03-02 00:40 -0500
                          Re: eForth specific words? Paul Rubin <no.email@nospam.invalid> - 2017-03-01 21:57 -0800
                Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-03-01 03:13 -0800
                  Re: eForth specific words? Mark Wills <markwills1970@gmail.com> - 2017-03-01 03:29 -0800
                    Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-03-01 10:49 -0800
                      Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-03-01 14:13 -0500
                      Re: eForth specific words? Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> - 2017-03-11 12:39 +0000
                        Re: eForth specific words? pbro <peter040@sympatico.ca> - 2017-03-11 13:09 -0800
                          Re: eForth specific words? Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> - 2017-03-12 10:22 +0000
                            Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-03-12 03:57 -0700
                              Re: eForth specific words? Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> - 2017-03-12 15:03 +0000
                  Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 09:42 -0600
                    Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 10:27 -0600
                      Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-03-01 11:12 -0800
                        Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-03-01 14:19 -0500
                        Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 14:34 -0600
                      Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-03-01 14:16 -0500
                  Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-03-01 14:08 -0500
                    Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-03-01 11:22 -0800
                      Re: eForth specific words? Paul Rubin <no.email@nospam.invalid> - 2017-03-01 11:29 -0800
                        Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 14:54 -0600
                      Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-03-01 18:00 -0500
                Re: eForth specific words? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-03-01 13:33 +0100
                  Re: eForth specific words? Mark Wills <markwills1970@gmail.com> - 2017-03-01 06:19 -0800
                    Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-03-01 14:17 -0500
                  Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 09:54 -0600
          Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-02-27 14:21 -0500
        Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-02-27 11:08 -0600
          Re: eForth specific words? Michael Barry <barrym95838@yahoo.com> - 2017-02-27 09:17 -0800
            Re: eForth specific words? Michael Barry <barrym95838@yahoo.com> - 2017-02-27 09:38 -0800
            Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-02-27 12:34 -0600
              Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-02-27 14:23 -0500
                Re: eForth specific words? Michael Barry <barrym95838@yahoo.com> - 2017-02-27 11:49 -0800
                  Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-02-27 15:14 -0500
                    Re: eForth specific words? Michael Barry <barrym95838@yahoo.com> - 2017-02-27 12:39 -0800
                      Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-02-27 15:04 -0600
                        Re: eForth specific words? Michael Barry <barrym95838@yahoo.com> - 2017-02-27 14:31 -0800
                      Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-02-27 17:44 -0500
          Re: eForth specific words? Paul Rubin <no.email@nospam.invalid> - 2017-02-27 23:11 -0800
            Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-02-27 23:22 -0800
              Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-02-28 01:26 -0600
                Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-02-28 00:58 -0800
                  Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-02-28 10:24 -0600
            Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-02-28 01:25 -0600
              Re: eForth specific words? Paul Rubin <no.email@nospam.invalid> - 2017-02-28 03:44 -0800
                Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-02-28 09:56 -0800
                  Re: eForth specific words? Paul Rubin <no.email@nospam.invalid> - 2017-02-28 14:16 -0800
                    Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-02-28 20:03 -0500
                Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-02-28 12:12 -0600
                  Re: eForth specific words? Paul Rubin <no.email@nospam.invalid> - 2017-02-28 14:19 -0800
                    Re: eForth specific words? Cecil Bayona <cbayona@cbayona.com> - 2017-02-28 16:49 -0600
                      Re: eForth specific words? Paul Rubin <no.email@nospam.invalid> - 2017-02-28 15:07 -0800
        Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-02-27 14:19 -0500
    Re: eForth specific words? David Schultz <abuse@127.0.0.1> - 2017-02-26 20:15 -0600
      Re: eForth specific words? Michael Barry <barrym95838@yahoo.com> - 2017-02-26 20:15 -0800
    Re: eForth specific words? Julian Fondren <julian.fondren@gmail.com> - 2017-02-26 18:20 -0800
      Re: eForth specific words? David Schultz <abuse@127.0.0.1> - 2017-02-26 20:33 -0600
        Re: eForth specific words? rickman <gnuarm@gmail.com> - 2017-02-26 22:18 -0500
    Re: eForth specific words? JUERGEN <epldfpga@aol.com> - 2017-02-27 03:19 -0800
      Re: eForth specific words? Michael Barry <barrym95838@yahoo.com> - 2017-02-27 08:08 -0800
    Re: eForth specific words? "HAA" <someone@microsoft.com> - 2017-02-28 19:30 +1100
    Re: eForth specific words? jacko <jackokring@gmail.com> - 2017-03-01 11:43 -0800
      Re: eForth specific words? jacko <jackokring@gmail.com> - 2017-03-01 12:16 -0800

Page 5 of 5 — ← Prev page 1 2 3 4 [5]


#55241

From"HAA" <someone@microsoft.com>
Date2017-02-28 19:30 +1100
Message-ID<o93cb1$hg4$1@gioia.aioe.org>
In reply to#55129
Michael Barry wrote:
> Hi all.  I ran into the non-standard words FOR AFT NEXT while playing around
>  with eForth.  I understand that FOR and NEXT are frowned upon by experienced
>  "old-schoolers" in a manner not unlike PICK and ROLL, but they're easy enough
>  to implement and understand.
>
>  The problem I'm having is understanding how
>  AFT works and using it inside (or even outside) a FOR ... NEXT loop.  AFT
>  appears to always be paired with a THEN but that's about all I have been able
>  to learn with any certainty.  I have noticed in the examples I've found that
>  there aren't any words between FOR and AFT nor any words between AFT's THEN
>  and NEXT ... is this state of affairs mandatory or optional, and if optional
>  how would those intervening words act, generally speaking?
>
> TIA
>
> Mike B.

FOR NEXT came from cmForth as a replacement for DO LOOP.  The latter
was deemed too expensive to implement on Forth chips.  Implementations
vary e.g. cmForth's iterates n+1 times for reasons peculiar to Novix.

eForth creator Bill Muench provides this diagram & test to explain how
FOR NEXT works with AFT and WHILE.  Use fixed-width font to view.

\     v--------<<
\ FOR ... NEXT a1 ...
\
\     v---------------------<<          >>----------v
\ FOR ... WHILE a1 ... NEXT a2 ... ELSE a3 ... THEN ...
\               >>-------------------------^
\
\                v-----------------<<
\ FOR ... AFT a1 ... THEN ... NEXT a2 ...
\             >>----------^

( test FOR-NEXT ============================================= )

: N1 ( -- ) 9 FOR R@ . NEXT ;
: N2 ( -- ) 9 FOR 5 R@ < WHILE R@ . NEXT ." X" ELSE R> DROP ." Y" THEN ;
: N3 ( -- ) 9 FOR ." X" AFT ." Y" THEN R@ . NEXT ;

Results using Bill's eForth

ok N1 9 8 7 6 5 4 3 2 1 0
ok N2 9 8 7 6 Y
ok N3 X9 Y8 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0




[toc] | [prev] | [next] | [standalone]


#55323

Fromjacko <jackokring@gmail.com>
Date2017-03-01 11:43 -0800
Message-ID<3caad828-760b-44af-b666-f3cf64a8cb19@googlegroups.com>
In reply to#55129
It weird ... 

initialize
begin
?leave
end

It's general. ... Sounds strange.

[toc] | [prev] | [next] | [standalone]


#55327

Fromjacko <jackokring@gmail.com>
Date2017-03-01 12:16 -0800
Message-ID<d0894934-ced7-4289-b1d5-5ce3aff2db3a@googlegroups.com>
In reply to#55323
... x FOR ... I ... ?BREAK ... z ?STEP ... y STEP ... NEXT ...

: NEXT 1 LITERAL STEP ; IMMEDIATE

: ?STEP COMPILE >R [COMPILE] IF COMPILE R> STEP [COMPILE] THEN COMPILE R> ; IMMEDIATE

...

[toc] | [prev] | [standalone]


Page 5 of 5 — ← Prev page 1 2 3 4 [5]

Back to top | Article view | comp.lang.forth


csiph-web