1. - - 16


43

( 31.03.86 .VOC (VOC/ VOCS ) : .VOC ( PFA+2-> ) 2- BODY> >NAME ID. ; : (VOC) ( PFA1+2->PFA2,N) @ 0 BEGIN OVER DUP IF @ [ &DWORD ] LITERAL <> THEN WHILE 1+ ( ) SWAP N>LINK @ SWAP REPEAT ; : VOCS ( -> ) -1 ['] FORTH >BODY 2+ CURRENT @ ." CURRENT: " DUP .VOC OVER @ OVER @ = IF DROP THEN CONTEXT @ ." CONTEXT: " DUP .VOC OVER @ OVER @ = IF DROP THEN CR ." : " BEGIN 2- BEGIN 2+ DUP .VOC (VOC) DROP DUP 0= UNTIL DROP DUP -1 = UNTIL DROP CR ." : " VOC-LINK @ BEGIN DUP 2- .VOC @ DUP 0= UNTIL DROP ;

44

( 31.03.86 WORDS ) : WORDS ( -> ) ." " CONTEXT @ DUP .VOC DUP (VOC) ." - " . ." C - " ?DUP IF 2+ .VOC THEN CR @ BEGIN DUP DUP IF @ [ &DWORD ] LITERAL <> THEN WHILE DUP C@ [ &SFLAG ] LITERAL AND 0= IF DUP ID. SPACE THEN N>LINK @ REPEAT DROP ;

45

( 31.03.86 (FORGET/ FORGET REMEMBER FORGET0 ) : (FORGET) ( A-> ) DUP FENCE @ U< ABORT" FENCE" >R VOC-LINK @ BEGIN R@ OVER U< WHILE FORTH DEFINITIONS @ DUP VOC-LINK ! REPEAT ( , ) BEGIN DUP 4 - BEGIN N>LINK @ DUP R@ U< UNTIL OVER 2- ! @ ?DUP 0= UNTIL R> DP! ; : FORGET ( ->) ' >NAME (FORGET) ; : REMEMBER ( ->) CREATE DOES> (FORGET) ;

46

( 31.09.86 (#SCR/ LIST SCR? INDEX ) : (#SCR) ( N->A,T N ) BASE @ >R DECIMAL 0 <# #S #> R> BASE ! ; : LIST ( N-> N, "SCR" ) DUP SCR ! CR ." " DUP (#SCR) TYPE BLOCK 16 0 DO DUP I 64 * + CR I 3 .R SPACE 64 TYPE LOOP DROP ;

47

( 31.03.86 ) : BEGIN ?COMP <MARK 1 ; IMMEDIATE : UNTIL 1 ?PAIRS COMPILE ?BRANCH <RESOLVE ; IMMEDIATE : AGAIN 1 ?PAIRS COMPILE BRANCH <RESOLVE ; IMMEDIATE : IF ?COMP COMPILE ?BRANCH &gtMARK 2 ; IMMEDIATE : THEN 2 ?PAIRS &gtRESOLVE ; IMMEDIATE : ELSE 2 ?PAIRS COMPILE BRANCH &gtMARK SWAP &gtRESOLVE 2 ; IMMEDIATE : WHILE 1 ?PAIRS 1 [COMPILE] IF ; IMMEDIATE : REPEAT &gtR &gtR [COMPILE] AGAIN R&gt R&gt [COMPILE] THEN ; IMMEDIATE : DO ?COMP COMPILE (DO) &gtMARK <MARK 3 ; IMMEDIATE : LOOP 3 ?PAIRS COMPILE (LOOP) <RESOLVE &gtRESOLVE ; IMMEDIATE : +LOOP 3 ?PAIRS COMPILE (+LOOP) <RESOLVE &gtRESOLVE ; IMMEDIATE