X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=src%2Flib_9_vocab.4th;h=7e574b755b24dcb23d6fd8cb7fb13ecaa65ffccf;hb=d6050ef0cc01079bc3b7237cf5dad2290884f566;hp=2b107306b81536809256f0bc9ec5168b1de0eaab;hpb=3c35d5caec5303e84c5de9dde74759f38280a3d3;p=forth.jl.git diff --git a/src/lib_9_vocab.4th b/src/lib_9_vocab.4th index 2b10730..7e574b7 100644 --- a/src/lib_9_vocab.4th +++ b/src/lib_9_vocab.4th @@ -10,3 +10,49 @@ BL WORD FIND DROP >NAME DUP @ F_HIDDEN OR SWAP ! ; + +: VOCAB>LATEST ( vcfa -- vlatest ) + 1+ @ @ ; + +: ALSO + context #context @ + dup 1- @ swap ! + 1 #context +! +; + +\ Create new vocabulary +: VOCABULARY + create 0 , +does> + body> context #context @ 1- + ! +; + +: DEFINITIONS + context @ current ! +; + +vocabulary root +also root definitions + +: FORTH forth ; + +: ONLY + 1 #context ! + root + 2 #context ! +; + +\ only forth + +\ Display search order and compilation dictionary +: ORDER + + \ Search order + context #context @ 1- + context swap + do + i @ >name .name space + -1 +loop + + \ Current (definitions) + 9 emit + current @ >name .name +;