>R, R> in interpret mode 
Author Message
 >R, R> in interpret mode

Quote:
> So how did you make >R and R> work in interpret mode, Mitch?

I rearranged the text interpreter so that the word is EXECUTEd in the
outer loop.  Something like this:

VARIABLE WORD-TO-EXECUTE

: INTERPRET-WORD  ( counted-string -- )
   FIND
   (decide if the word should be compiled or executed)  IF
       WORD-TO-EXECUTE !        \ If it should be executed
   ELSE
       ,                        \ If it should be compiled
   THEN
;
: INTERPRET
    BEGIN

    WHILE
       ['] NOOP  WORD-TO-EXECUTE !
       INTERPRET-WORD

    REPEAT
    DROP
;

This isn't my exact code, but you get the idea.

Another solution would be to write the outer interpreter as one big
word, like in FIG Forth.  The key point is that the "EXECUTE" must
be at the same nesting level as the interpreter loop.

Oh, one key point about my system, that makes this all possible:
INTERPRET does not exit at the end of every line!  In my implementation,
WORD reads across line boundaries.

Without this feature, the only solution I can think of offhand is to
completely "unfactor" QUIT into one giant word, i.e.

: QUIT
    BEGIN
       QUERY

          FIND ...
             EXECUTE
          ELSE
             ,
          THEN
       REPEAT   DROP
   AGAIN
;

Mitch



Sat, 13 Mar 1993 02:06:40 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. >R, R> in interpret mode

2. HELP>>>>>>>Fortran-Pascal Linking

3. >>>>>>>FROM SMTK TO C++

4. ><><><><>Heeeeeeeeeeeeeeelp on INT 14!><><><><><>

5. <<<<<YOU MUST CHECK THIS OUT >>>>>>>>>> 2103

6. >>>>>AVL tree

7. >>>>>How to read a IMAGE file?(BMP, GIF)|||||||||

8. ANNOUNCE>>>>>TOTAL FrameWork from Cincom

9. Slow/No Speed>>>>>>>>>

10. >>>>VHDL tutorial text: Summary >>>>

11. Graphics>>Rectangle>>intersects: erroneous code

12. **>>CO Smalltalk Developer!!>>**

 

 
Powered by phpBB® Forum Software