]> gitweb.factorcode.org Git - factor.git/blobdiff - core/vocabs/vocabs.factor
core/basis: Rename words dealing with vocabs to loaded-vocabs or disk-vocabs because...
[factor.git] / core / vocabs / vocabs.factor
index 157213b44de7ab608a9e83e13512d79f1e8964fa..a8dd27f2e9e3bac5ca2928171d879ee6bade194b 100644 (file)
@@ -44,7 +44,7 @@ M: object vocab-name check-vocab-name ;
 : 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 )
@@ -53,13 +53,13 @@ M: vocab lookup-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 )
 
@@ -96,18 +96,18 @@ GENERIC: vocab-changed ( vocab obj -- )
 
 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 -- ? )
@@ -119,8 +119,8 @@ ERROR: no-vocab 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 )
 
@@ -129,7 +129,7 @@ M: vocab-spec >vocab-link ;
 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 ;