Added vlist

This commit is contained in:
Brad Nelson
2021-02-06 15:12:02 -08:00
parent 1a628074ce
commit 84a2ae26b1
2 changed files with 13 additions and 0 deletions

View File

@ -2,3 +2,5 @@
: forth [ current @ ] literal context ! ;
: vocabulary ( "name" ) create 0 , current @ 2 cells + , does> cell+ context ! ;
: definitions context @ current ! ;
: vlist 0 context @ @ begin onlines dup see. >link dup 0= if 2drop cr exit then
dup >name nip 0= until 2drop cr ;

View File

@ -7,7 +7,18 @@ e: test-vocabularies
foo test
bar test
foo test
forth definitions
out: AAAA
out: BBBB
out: AAAA
;e
e: test-vlist
vocabulary foo
foo definitions
: pig ; : cow ; : sheep ;
forth definitions
foo vlist
forth definitions
out: sheep cow pig
;e