Implemented CURRENT, FORTH, ORDER.
[forth.jl.git] / src / lib_9_vocab.4th
1 \ Vocabulary management
2
3 : FORGET
4         BL WORD FIND >LINK  ( find the word, gets the dictionary entry address )
5         DUP @ LATEST !      ( set LATEST to point to the previous word )
6         H !                 ( and store H with the dictionary address )
7 ;
8
9 : HIDE
10         BL WORD FIND DROP >NAME
11         DUP @ F_HIDDEN OR SWAP !
12 ;
13
14 : VOCAB>LATEST ( vcfa -- vlatest )
15         1+ @ @ ;
16
17 : ORDER
18
19     \ Search order
20     context #context @ 1- + context
21     do
22         i @ >name .name
23     loop
24
25     \ Current (definitions)
26     9 emit
27     current @ >name .name
28 ;