Simplify VALUE
authorPhil Burk <philburk@mobileer.com>
Sun, 6 Sep 2020 01:25:27 +0000 (18:25 -0700)
committerPhil Burk <philburk@mobileer.com>
Sun, 6 Sep 2020 01:25:27 +0000 (18:25 -0700)
Now it does not produce an IMMEDIATE word.
This allows it to pass some standard tests.

Fixes #20

fth/ansilocs.fth

index 3423bfc..923eef2 100644 (file)
@@ -139,19 +139,11 @@ if.forgotten lv.term
     THEN
 ;
 
     THEN
 ;
 
-
 : VALUE
     CREATE ( n <name> )
         ,
 : VALUE
     CREATE ( n <name> )
         ,
-        immediate
     DOES>
     DOES>
-        state @
-        IF
-            [compile] aliteral
-            compile @
-        ELSE
-            @
-        THEN
+        @
 ;
 
 : TO  ( val <name> -- )
 ;
 
 : TO  ( val <name> -- )
@@ -161,7 +153,7 @@ if.forgotten lv.term
         lv.compile.store
     ELSE
         find
         lv.compile.store
     ELSE
         find
-        1 = 0= abort" TO or -> before non-local or non-value"
+        0= abort" not found"
         >body  \ point to data
         state @
         IF  \ compiling  ( -- pfa )
         >body  \ point to data
         state @
         IF  \ compiling  ( -- pfa )
@@ -183,7 +175,7 @@ if.forgotten lv.term
         [compile] literal compile (local+!)
     ELSE
         find
         [compile] literal compile (local+!)
     ELSE
         find
-        1 = 0= abort" +-> before non-local or non-value"
+        0= abort" not found"
         >body  \ point to data
         state @
         IF  \ compiling  ( -- pfa )
         >body  \ point to data
         state @
         IF  \ compiling  ( -- pfa )