]> gitweb.factorcode.org Git - factor.git/commitdiff
help.vocabs: inform the user when browsing a vocab that is not loaded.
authorKeith Lazuka <klazuka@gmail.com>
Mon, 14 Sep 2009 15:13:45 +0000 (11:13 -0400)
committerKeith Lazuka <klazuka@gmail.com>
Mon, 14 Sep 2009 15:13:45 +0000 (11:13 -0400)
basis/help/vocabs/vocabs.factor

index e8b145d37ee77366dbea6455a0a886dd0d6a07ed..a7cd70707dcbc52a3072c44af004857a01e03881 100644 (file)
@@ -227,6 +227,15 @@ C: <vocab-author> vocab-author
         ] bi
     ] unless-empty ;
 
+: vocab-is-not-loaded ( vocab -- )
+    "Attention" $heading
+    vocab-name dup "The " " vocabulary is not loaded. In order to browse "
+    "its documentation, you must first load it." append surround print-element
+    "USE: " prepend 1array $code ;
+
+: describe-words ( vocab -- )
+    dup vocab [ words $words ] [ vocab-is-not-loaded ] if ;
+
 : words. ( vocab -- )
     last-element off
     [ require ] [ words $words ] bi nl ;
@@ -243,7 +252,7 @@ C: <vocab-author> vocab-author
     first {
         [ describe-help ]
         [ describe-metadata ]
-        [ words $words ]
+        [ describe-words ]
         [ describe-files ]
         [ describe-children ]
     } cleave ;