IN: vocabs.tests
[ f ] [ "kernel" vocab-main ] unit-test
+
+[ t ] [ "" "" child-vocab? ] unit-test
+[ t ] [ "" "io.files" child-vocab? ] unit-test
+[ t ] [ "io" "io.files" child-vocab? ] unit-test
+[ f ] [ "io.files" "io" child-vocab? ] unit-test
+
+[ t ] [ "io.files" "io" parent-vocab? ] unit-test
+[ f ] [ "io" "io.files" parent-vocab? ] unit-test
: child-vocabs ( vocab -- seq )
vocab-name vocabs [ child-vocab? ] with filter ;
+: parent-vocab? ( suffix name -- ? )
+ swap child-vocab? ;
+
+: parent-vocabs ( vocab -- seq )
+ vocab-name vocabs [ parent-vocab? ] with filter ;
+
GENERIC: >vocab-link ( name -- vocab )
M: vocab-spec >vocab-link ;