Added vlist
This commit is contained in:
@ -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 ;
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user