FORGET works with vocabularies. Updated readme.
[forth.jl.git] / src / lib_8_vocab.4th
index 34b8251..e0ba306 100644 (file)
@@ -1,9 +1,16 @@
 \ Vocabulary management
 
+\ Forget word and everything defined after it in compilation dict
 : FORGET
-        BL WORD FIND >LINK  ( find the word, gets the dictionary entry address )
+        BL WORD CURRENT @ FINDVOCAB ( find the word, gets the dictionary entry address )
+
+        0= if
+                drop exit
+        then
+
+        >link
+
         DUP @ LATEST !      ( set LATEST to point to the previous word )
-        H !                 ( and store H with the dictionary address )
 ;
 
 : HIDE
@@ -11,9 +18,6 @@
         DUP @ F_HIDDEN OR SWAP !
 ;
 
-: VOCAB>LATEST ( vcfa -- vlatest )
-        1+ @ @ ;
-
 \ Create new vocabulary
 : VOCABULARY
         create 0 ,