Ok After a lot of trial and error, as well as a lot of searching, I found something that should work, but due to two errors in redFORTH does not work.
VALUE
\ Works fine, now to reset the value. : VALUE \ n <name>
TO
\ Works if not compiling, LITERAL and POSTPONE are broken. : TO TIBWORD FIND 3 + STATE @ IF POSTPONE LITERAL POSTPONE ! ELSE ! THEN ; IMMEDIATE
Demonstration of an error in LITERAL
\ fails, very wierd error. : TESTLIT [ 42 ] LITERAL ; \ TESTLIT Unknown Token: TESTLIT \ FORGET TESTLIT Unknown Token: TESTLIT \ WORDS TESTLIT COLD SORTMATCH ...
POSTPONE error demonstration
\ fails, postpone is directly equivelent to ['] : TESTPOST POSTPONE + ; IMMEDIATE : TEST 2 2 TESTPOST . ; \ . 1935 \ ' + . 1935
I want to write an error report ....
EDIT # 1: After some trial and error and a lot of swearing (I'm not very good with FORTH), I found a way to make it work.
: TO TIBWORD FIND 3 + STATE @ IF (lit) (lit) , , \ store address (lit) ! , ELSE ! THEN ; IMMEDIATE
Milo christiansen
source share