]> gitweb.factorcode.org Git - factor.git/commitdiff
vocabs.metadata: change vocab-summary to just be summary.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 22 Mar 2021 20:20:43 +0000 (13:20 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 22 Mar 2021 20:20:43 +0000 (13:20 -0700)
Have a separate word that is used in M\ vocab summary

basis/vocabs/metadata/metadata.factor

index 160a24f77a22771da8cade8212f865a5a3e5b95b..30c37998a0a82b23e1b6283df51145a4048c2cd4 100644 (file)
@@ -37,25 +37,25 @@ MEMO: vocab-file-lines ( vocab name -- lines/f )
 : vocab-summary-path ( vocab -- path/f )
     "summary.txt" vocab-file-path ;
 
-: vocab-in-root-summary ( vocab -- string )
-    vocab-name dup
-    ".private" ?tail drop find-vocab-root
-    [ "`" "'" surround " in " glue ] when* ;
-
 : vocab-summary ( vocab -- summary )
-    [ "summary.txt" vocab-file-lines [ first ] [ f ] if* ]
-    [ vocab-in-root-summary ] bi
-    over [ ", " glue ] [ nip ] if ;
+    "summary.txt" vocab-file-lines [ first ] [ f ] if* ;
+
+: vocab-in-root-summary ( vocab -- string )
+    [ vocab-summary ] [
+        vocab-name dup
+        ".private" ?tail drop find-vocab-root
+        [ "`" "'" surround " in " glue ] when*
+    ] bi over [ ", " glue ] [ nip ] if ;
 
 M: vocab summary
     [
-        dup vocab-summary %
+        dup vocab-in-root-summary %
         " (" %
         words>> assoc-size #
         " words)" %
     ] "" make ;
 
-M: vocab-link summary vocab-summary ;
+M: vocab-link summary vocab-in-root-summary ;
 
 : vocab-tags-path ( vocab -- path/f )
     "tags.txt" vocab-file-path ;