1 \ Vocabulary management
3 \ Forget word and everything defined after it in compilation dict
5 BL WORD CURRENT @ FINDVOCAB ( find the word, gets the dictionary entry address )
13 dup @ current @ 1+ ! ( set LATEST to point to the previous word )
18 BL WORD FIND DROP >NAME
19 DUP @ F_HIDDEN OR SWAP !
23 1+ ( skip over the link pointer )
24 @ ( get the flags/length byte )
25 F_HIDDEN AND ( mask the F_HIDDEN flag and return it (as a truth value) )
28 \ Display name of word
30 DUP @ ( get the flags/length byte )
31 F_LENMASK AND ( mask out the flags - just want the length )
34 DUP 0> ( length > 0? )
36 SWAP 1+ ( addr len -- len addr+1 )
37 DUP @ ( len addr -- len addr char | get the next character)
39 EMIT ( len addr char -- len addr | and print it)
45 SWAP 1- ( len addr -- addr len-1 | subtract one from length )
50 \ Create new vocabulary
54 body> context #context @ 1- + !
58 context #context @ 1- + @ current !
61 \ Define root vocabulary (always available)
73 1 <= abort" Cannot empty search order stack!"
79 context #context @ + dup 1- @ swap !
87 \ Display search order and compilation dictionary
91 context #context @ 1- + context swap
96 \ Current (definitions)
101 \ Display transient vocabulary contents
104 context #context @ 1- + @
107 ?DUP ( while link pointer is not 0 )
109 DUP ?HIDDEN NOT IF ( ignore hidden words )
110 DUP 1+ .NAME ( but if not hidden, print the word )
113 @ ( dereference the link pointer - go to previous word )
118 only forth also definitions