: vocab-name* ( vocab-spec -- name )
vocab-name ".private" ?tail drop ;
-: private-vocab? ( vocab -- ? )
+: private-vocab? ( vocab-spec -- ? )
vocab-name ".private" tail? ;
GENERIC: lookup-vocab ( vocab-spec -- vocab )
M: object lookup-vocab ( name -- vocab ) vocab-name dictionary get at ;
-GENERIC: vocab-words ( vocab-spec -- words )
+GENERIC: vocab-words-assoc ( vocab-spec -- assoc/f )
-M: vocab vocab-words words>> ;
+M: vocab vocab-words-assoc words>> ;
-M: object vocab-words lookup-vocab vocab-words ;
+M: object vocab-words-assoc lookup-vocab vocab-words-assoc ;
-M: f vocab-words ;
+M: f vocab-words-assoc ;
GENERIC: vocab-help ( vocab-spec -- help )
ERROR: no-vocab name ;
-: vocabs ( -- seq )
+: loaded-vocab-names ( -- seq )
dictionary get keys natural-sort ;
-: words ( vocab -- seq )
- vocab-words values ;
+: vocab-words ( vocab-spec -- seq )
+ vocab-words-assoc values ;
: all-words ( -- seq )
- dictionary get values [ words ] map concat ;
+ dictionary get values [ vocab-words ] map concat ;
: words-named ( str -- seq )
dictionary get values
- [ vocab-words at ] with map
+ [ vocab-words-assoc at ] with map
sift ;
: child-vocab? ( prefix name -- ? )
] if
] if-empty ;
-: child-vocabs ( vocab -- seq )
- vocab-name vocabs [ child-vocab? ] with filter ;
+: loaded-child-vocab-names ( vocab-spec -- seq )
+ vocab-name loaded-vocab-names [ child-vocab? ] with filter ;
GENERIC: >vocab-link ( name -- vocab )
M: object >vocab-link dup lookup-vocab [ ] [ <vocab-link> ] ?if ;
: forget-vocab ( vocab -- )
- [ words forget-all ]
+ [ vocab-words forget-all ]
[ vocab-name dictionary get delete-at ]
[ notify-vocab-observers ] tri ;