]> gitweb.factorcode.org Git - factor.git/commitdiff
bootstrap.*: fix for #1512, load docs after everything else
authorBjörn Lindqvist <bjourne@gmail.com>
Fri, 4 Dec 2015 12:29:29 +0000 (13:29 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Fri, 4 Dec 2015 12:29:29 +0000 (13:29 +0100)
By making it so the help component is loaded almost last, all vocabs are loaded without docs and only then are they loaded. It should make it so you don't get cyclic dependency problems in doc files during bootstrapping.

basis/bootstrap/help/help.factor
basis/bootstrap/stage2.factor
basis/bootstrap/ui/tools/tools.factor
basis/ui/commands/commands-docs.factor
basis/ui/commands/commands.factor

index 85e94d5a1e6941576e98040eb1d13a26ee84a403..71e64dc725df109b95528fa088a602c4a809926c 100644 (file)
@@ -1,22 +1,20 @@
-USING: accessors assocs kernel namespaces sequences vocabs
-vocabs.loader vocabs.loader.private ;
+USING: accessors assocs namespaces sequences vocabs vocabs.loader
+vocabs.loader.private ;
 IN: bootstrap.help
 
 : load-help ( -- )
-    "help" require
-    "help.topics" require
-    "help.syntax" require
-    "help.crossref" require
-    "help.definitions" require
-    "help.lint" require
-    "help.vocabs" require
+    {
+        "help"
+        "help.topics"
+        "help.syntax"
+        "help.crossref"
+        "help.definitions"
+        "help.lint"
+        "help.vocabs"
+    } [ require ] each
 
     t load-help? set-global
 
-    [ dup lookup-vocab [ drop ] [ no-vocab ] if ] require-hook [
-        dictionary get values
-        [ docs-loaded?>> ] reject
-        [ load-docs ] each
-    ] with-variable ;
+    dictionary get values [ docs-loaded?>> ] reject [ load-docs ] each ;
 
 load-help
index 9f59bfb61358ea97492f306c4f409972053f9ee7..320d853f1b6abb992540e712096e934cf9656411 100644 (file)
@@ -56,7 +56,7 @@ SYMBOL: bootstrap-time
     error set-global ; inline
 
 CONSTANT: default-components
-    "math compiler threads help io tools ui ui.tools unicode handbook"
+    "math compiler threads io tools ui ui.tools unicode help handbook"
 
 [
     ! We time bootstrap
index 2de9be377aaff0d1b7f0ef8acef5242926dc8774..c5fd8f2e15ac625044d5ffb18594fd4feb9d32df 100644 (file)
@@ -1,10 +1,8 @@
-USING: kernel vocabs sequences system vocabs.loader ;
+USING: vocabs vocabs.loader ;
+IN: bootstrap.ui.tools
 
-{ "ui" "help" "tools" }
-[ "bootstrap." prepend lookup-vocab ] all? [
-    "ui.tools" require
+"ui.tools" require
 
-    { "ui.backend.cocoa" } "ui.backend.cocoa.tools" require-when
+{ "ui.backend.cocoa" } "ui.backend.cocoa.tools" require-when
 
-    "ui.tools.walker" require
-] when
+"ui.tools.walker" require
index 3e5c7f46ae3694a497924233c2d982b6c50a5852..46562c8c6ae18002c1a85fe40750efce1e9439a4 100644 (file)
@@ -3,35 +3,6 @@ hashtables quotations words classes sequences namespaces make
 arrays assocs ;
 IN: ui.commands
 
-: command-map-row ( gesture command -- seq )
-    [
-        [ gesture>string , ]
-        [
-            [ command-name , ]
-            [ command-word <$link> , ]
-            [ command-description , ]
-            tri
-        ] bi*
-    ] { } make ;
-
-: command-map. ( alist -- )
-    [ command-map-row ] { } assoc>map
-    { "Shortcut" "Command" "Word" "Notes" }
-    [ \ $strong swap ] { } map>assoc prefix
-    $table ;
-
-: $command-map ( element -- )
-    [ second (command-name) " commands" append $heading ]
-    [
-        first2 swap get-command-at
-        [ blurb>> print-element ] [ commands>> command-map. ] bi
-    ] bi ;
-
-: $command ( element -- )
-    reverse first3 get-command-at
-    commands>> value-at gesture>string
-    $snippet ;
-
 HELP: +nullary+
 { $description "A key which may be set in the hashtable passed to " { $link define-command } ". If set to a true value, the command does not take any inputs, and the value passed to " { $link invoke-command } " will be ignored. Otherwise, it takes one input." } ;
 
index 8dc8555424f4fffc817a668c990fe273be409d89..713a3b1204ffee76d25dc0d2be8915d6935cfd71 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2006, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors assocs fry kernel make quotations sequences
-splitting tr ui.gestures unicode.case unicode.categories words ;
+USING: accessors assocs fry help.markup kernel make quotations
+sequences splitting tr ui.gestures unicode.case unicode.categories
+words ;
 IN: ui.commands
 
 SYMBOL: +nullary+
@@ -28,9 +29,43 @@ GENERIC: command-word ( command -- word )
         H{ } clone [ "commands" set-word-prop ] keep
     ] ?if ;
 
+TR: convert-command-name "-" " " ;
+
+: (command-name) ( string -- newstring )
+    convert-command-name >title ;
+
 : get-command-at ( group class -- command-map )
     commands at ;
 
+: command-map-row ( gesture command -- seq )
+    [
+        [ gesture>string , ]
+        [
+            [ command-name , ]
+            [ command-word <$link> , ]
+            [ command-description , ]
+            tri
+        ] bi*
+    ] { } make ;
+
+: command-map. ( alist -- )
+    [ command-map-row ] { } assoc>map
+    { "Shortcut" "Command" "Word" "Notes" }
+    [ \ $strong swap ] { } map>assoc prefix
+    $table ;
+
+: $command-map ( element -- )
+    [ second (command-name) " commands" append $heading ]
+    [
+        first2 swap get-command-at
+        [ blurb>> print-element ] [ commands>> command-map. ] bi
+    ] bi ;
+
+: $command ( element -- )
+    reverse first3 get-command-at
+    commands>> value-at gesture>string
+    $snippet ;
+
 : command-gestures ( class -- hash )
     commands values [
         [
@@ -48,11 +83,6 @@ GENERIC: command-word ( command -- word )
     swap pick commands set-at
     update-gestures ;
 
-TR: convert-command-name "-" " " ;
-
-: (command-name) ( string -- newstring )
-    convert-command-name >title ;
-
 M: word command-name ( word -- str )
     name>>
     "com-" ?head drop "." ?tail drop