]> gitweb.factorcode.org Git - factor.git/commitdiff
Split up tools.vocabs. Note that load-everything is now named load-all
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 4 May 2009 11:44:17 +0000 (06:44 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 4 May 2009 11:44:17 +0000 (06:44 -0500)
74 files changed:
basis/bootstrap/tools/tools.factor
basis/editors/editors.factor
basis/help/apropos/apropos.factor
basis/help/handbook/handbook.factor
basis/help/html/html.factor
basis/help/lint/lint.factor
basis/help/tutorial/tutorial.factor
basis/help/vocabs/vocabs.factor
basis/http/server/server-docs.factor
basis/http/server/server.factor
basis/present/present-tests.factor
basis/tools/completion/completion.factor
basis/tools/deploy/config/editor/editor.factor
basis/tools/deploy/shaker/shaker.factor
basis/tools/test/test.factor
basis/tools/vocabs/monitor/authors.txt [deleted file]
basis/tools/vocabs/monitor/monitor-tests.factor [deleted file]
basis/tools/vocabs/monitor/monitor.factor [deleted file]
basis/tools/vocabs/monitor/summary.txt [deleted file]
basis/tools/vocabs/summary.txt [deleted file]
basis/tools/vocabs/vocabs-docs.factor [deleted file]
basis/tools/vocabs/vocabs-tests.factor [deleted file]
basis/tools/vocabs/vocabs.factor [deleted file]
basis/ui/backend/cocoa/tools/tools.factor
basis/ui/tools/listener/listener-docs.factor
basis/ui/tools/listener/listener.factor
basis/ui/tools/operations/operations.factor
basis/ui/tools/tools.factor
basis/vocabs/cache/authors.txt [new file with mode: 0644]
basis/vocabs/cache/cache.factor [new file with mode: 0644]
basis/vocabs/cache/summary.txt [new file with mode: 0644]
basis/vocabs/errors/authors.txt [new file with mode: 0644]
basis/vocabs/errors/errors.factor [new file with mode: 0644]
basis/vocabs/errors/summary.txt [new file with mode: 0644]
basis/vocabs/files/authors.txt [new file with mode: 0644]
basis/vocabs/files/files-docs.factor [new file with mode: 0644]
basis/vocabs/files/files.factor [new file with mode: 0644]
basis/vocabs/files/summary.txt [new file with mode: 0644]
basis/vocabs/hierarchy/hierarchy-docs.factor [new file with mode: 0644]
basis/vocabs/hierarchy/hierarchy-tests.factor [new file with mode: 0644]
basis/vocabs/hierarchy/hierarchy.factor [new file with mode: 0644]
basis/vocabs/hierarchy/summary.txt [new file with mode: 0644]
basis/vocabs/metadata/authors.txt [new file with mode: 0644]
basis/vocabs/metadata/metadata-docs.factor [new file with mode: 0644]
basis/vocabs/metadata/metadata.factor [new file with mode: 0644]
basis/vocabs/metadata/summary.txt [new file with mode: 0644]
basis/vocabs/refresh/authors.txt [new file with mode: 0644]
basis/vocabs/refresh/monitor/authors.txt [new file with mode: 0644]
basis/vocabs/refresh/monitor/monitor-tests.factor [new file with mode: 0644]
basis/vocabs/refresh/monitor/monitor.factor [new file with mode: 0644]
basis/vocabs/refresh/monitor/summary.txt [new file with mode: 0644]
basis/vocabs/refresh/refresh-docs.factor [new file with mode: 0644]
basis/vocabs/refresh/refresh.factor [new file with mode: 0644]
basis/vocabs/refresh/summary.txt [new file with mode: 0644]
core/alien/dlls/authors.txt [new file with mode: 0644]
core/alien/dlls/dlls.factor [new file with mode: 0644]
core/parser/parser.factor
core/source-files/source-files-docs.factor
core/vocabs/loader/loader-docs.factor
core/vocabs/loader/loader-tests.factor
extra/benchmark/benchmark.factor
extra/benchmark/gc0/authors.txt [new file with mode: 0644]
extra/benchmark/gc0/gc0.factor [new file with mode: 0644]
extra/benchmark/gc2/authors.txt [new file with mode: 0644]
extra/benchmark/gc2/gc2.factor [new file with mode: 0644]
extra/fuel/help/help.factor
extra/fuel/xref/xref.factor
extra/galois-talk/galois-talk.factor
extra/google-tech-talk/google-tech-talk.factor
extra/mason/common/common.factor
extra/mason/report/report.factor
extra/mason/test/test.factor
extra/otug-talk/otug-talk.factor
extra/vpri-talk/vpri-talk.factor

index cb0792ee1e2ddaf0a21cf98b433e1365a4038af9..6017469925719195280d486a5543402dfae3974b 100644 (file)
@@ -14,7 +14,8 @@ IN: bootstrap.tools
     "tools.test"
     "tools.time"
     "tools.threads"
-    "tools.vocabs"
-    "tools.vocabs.monitor"
+    "vocabs.hierarchy"
+    "vocabs.refresh"
+    "vocabs.refresh.monitor"
     "editors"
 } [ require ] each
index 6088400bd8e41d422675d403fa3c61477b103d16..d5b4b909e3a41ce04a11d87c144ae4bc76346f7f 100644 (file)
@@ -1,10 +1,10 @@
 ! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: parser lexer kernel namespaces sequences definitions io.files
-io.backend io.pathnames io summary continuations tools.crossref
-tools.vocabs prettyprint source-files source-files.errors assocs
-vocabs vocabs.loader splitting accessors debugger prettyprint
-help.topics ;
+USING: parser lexer kernel namespaces sequences definitions
+io.files io.backend io.pathnames io summary continuations
+tools.crossref vocabs.hierarchy prettyprint source-files
+source-files.errors assocs vocabs vocabs.loader splitting
+accessors debugger prettyprint help.topics ;
 IN: editors
 
 TUPLE: no-edit-hook ;
index b241db4c0eca3c8171d7ddae7591cbfed968ec20..63cbcb3f1ed0f63e80e9eb61fd5686ddce2f4095 100644 (file)
@@ -1,8 +1,8 @@
-! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs fry help.markup help.topics io
 kernel make math math.parser namespaces sequences sorting
-summary tools.completion tools.vocabs help.vocabs
+summary tools.completion vocabs.hierarchy help.vocabs
 vocabs words unicode.case help ;
 IN: help.apropos
 
index 262c46bbc3205c5b68989300ff116c769f1668c2..b83fb22ccfccf5bb0c91f6fe8baf76f3c5bc6921 100644 (file)
@@ -281,7 +281,7 @@ ARTICLE: "handbook-tools-reference" "Developer tools"
 { $heading "Workflow" }
 { $subsection "listener" }
 { $subsection "editor" }
-{ $subsection "tools.vocabs" }
+{ $subsection "vocabs.refresh" }
 { $subsection "tools.test" }
 { $subsection "help" }
 { $heading "Debugging" }
@@ -292,6 +292,7 @@ ARTICLE: "handbook-tools-reference" "Developer tools"
 { $heading "Browsing" }
 { $subsection "see" }
 { $subsection "tools.crossref" }
+{ $subsection "vocabs.hierarchy" }
 { $heading "Performance" }
 { $subsection "timing" }
 { $subsection "profiling" }
index f4a874248617f9645421e41e783e1a6b2e502ec0..348fcbbbfbb4990da457758ee20ca74cbe8aa921 100644 (file)
@@ -3,7 +3,7 @@
 USING: io.encodings.utf8 io.encodings.ascii io.encodings.binary
 io.files io.files.temp io.directories html.streams help kernel
 assocs sequences make words accessors arrays help.topics vocabs
-tools.vocabs help.vocabs namespaces prettyprint io
+vocabs.hierarchy help.vocabs namespaces prettyprint io
 vocabs.loader serialize fry memoize ascii unicode.case math.order
 sorting debugger html xml.syntax xml.writer math.parser ;
 IN: help.html
index 42f29bc8b7a7a9d9113f8006cbaaa07de5fae337..f25d5f0f9336b994f38966578db94db1b5050f4d 100755 (executable)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: assocs continuations fry help help.lint.checks
 help.topics io kernel namespaces parser sequences
-source-files.errors tools.vocabs vocabs words classes
+source-files.errors vocabs.hierarchy vocabs words classes
 locals tools.errors ;
 FROM: help.lint.checks => all-vocabs ;
 IN: help.lint
index 2ed18b7cd579623720b246c25bc41ea51b4097d8..7686022b705305060da28f57c7938e615da5a4d8 100644 (file)
@@ -1,6 +1,6 @@
 USING: help.markup help.syntax ui.commands ui.operations
 editors vocabs.loader kernel sequences prettyprint tools.test
-tools.vocabs strings unicode.categories unicode.case
+vocabs.refresh strings unicode.categories unicode.case
 ui.tools.browser ui.tools.common ;
 IN: help.tutorial
 
index a8c93feee48b5dab0606000f273432b1f035f61d..b23143e57287aaf427d64a60f331a6cf531d0bfe 100644 (file)
@@ -6,7 +6,8 @@ classes.singleton classes.tuple classes.union combinators
 definitions effects fry generic help help.markup help.stylesheet
 help.topics io io.files io.pathnames io.styles kernel macros
 make namespaces prettyprint sequences sets sorting summary
-tools.vocabs vocabs vocabs.loader words words.symbol definitions.icons ;
+vocabs vocabs.files vocabs.hierarchy vocabs.loader
+vocabs.metadata words words.symbol definitions.icons ;
 IN: help.vocabs
 
 : about ( vocab -- )
index 29f61416fa1fd003d4f9d1592b6dd2d520356278..daf03059727b4498f6e559b0ce75fc5f5de54dc1 100644 (file)
@@ -1,4 +1,4 @@
-USING: help.markup help.syntax io.streams.string quotations strings urls http tools.vocabs math io.servers.connection ;
+USING: help.markup help.syntax io.streams.string quotations strings urls http vocabs.refresh math io.servers.connection ;
 IN: http.server
 
 HELP: trivial-responder
index 8b22b9a8852e672218f748889bb1c5200b0227ff..3beb73049929c3eda95af527c5418a777c893f8a 100755 (executable)
@@ -1,8 +1,8 @@
-! Copyright (C) 2003, 2008 Slava Pestov.
+! Copyright (C) 2003, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel accessors sequences arrays namespaces splitting
 vocabs.loader destructors assocs debugger continuations
-combinators tools.vocabs tools.time math math.parser present
+combinators vocabs.refresh tools.time math math.parser present
 io vectors
 io.sockets
 io.sockets.secure
index 22d352cb5a86509b6f1d3ebf9a7d6d551afc2623..559b9ac01def838a9b5d77b0f88bc40e33f953cb 100644 (file)
@@ -1,5 +1,5 @@
 IN: present.tests
-USING: tools.test present math vocabs tools.vocabs sequences kernel ;
+USING: tools.test present math vocabs sequences kernel ;
 
 [ "3" ] [ 3 present ] unit-test
 [ "Hi" ] [ "Hi" present ] unit-test
index 99def097a25977126796ac2d3417f8fce55d9069..00d86a1608df9e4811d208c0274614709ed17ed3 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel arrays sequences math namespaces
-strings io fry vectors words assocs combinators sorting
-unicode.case unicode.categories math.order vocabs
-tools.vocabs unicode.data locals ;
+USING: accessors kernel arrays sequences math namespaces strings io
+fry vectors words assocs combinators sorting unicode.case
+unicode.categories math.order vocabs vocabs.hierarchy unicode.data
+locals ;
 IN: tools.completion
 
 :: (fuzzy) ( accum i full ch -- accum i full ? )
index ac89e3290bf024c4e32f3e9cc728674890e68ef3..78d86a470744bc9101071a7c3ae80a5ceb2414c5 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: assocs io.pathnames kernel parser prettyprint sequences
-splitting tools.deploy.config tools.vocabs vocabs.loader ;
+splitting tools.deploy.config vocabs.loader vocabs.metadata ;
 IN: tools.deploy.config.editor
 
 : deploy-config-path ( vocab -- string )
index 9b02d3208fe85549efe3b92f028717f63c9f4d35..fd43d1ccc9d512a2bc70819c7ca1c7d82c8ee68f 100755 (executable)
@@ -37,7 +37,7 @@ IN: tools.deploy.shaker
     ] when
     strip-dictionary? [
         "compiler.units" init-hooks get delete-at
-        "tools.vocabs" init-hooks get delete-at
+        "vocabs.cache" init-hooks get delete-at
     ] when ;
 
 : strip-debugger ( -- )
index c0c2f1892d57adb9b0c909f08b6b759b44fcd0de..3dc7b8740b171b1da5c60b78f47ef5c796333923 100644 (file)
@@ -4,9 +4,9 @@ USING: accessors arrays assocs combinators compiler.units
 continuations debugger effects fry generalizations io io.files
 io.styles kernel lexer locals macros math.parser namespaces
 parser prettyprint quotations sequences source-files splitting
-stack-checker summary unicode.case vectors vocabs vocabs.loader words
-tools.vocabs tools.errors source-files.errors io.streams.string make
-compiler.errors ;
+stack-checker summary unicode.case vectors vocabs vocabs.loader
+vocabs.files words tools.errors source-files.errors
+io.streams.string make compiler.errors ;
 IN: tools.test
 
 TUPLE: test-failure < source-file-error continuation ;
diff --git a/basis/tools/vocabs/monitor/authors.txt b/basis/tools/vocabs/monitor/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/tools/vocabs/monitor/monitor-tests.factor b/basis/tools/vocabs/monitor/monitor-tests.factor
deleted file mode 100644 (file)
index 0e767a3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-USING: tools.test tools.vocabs.monitor io.pathnames ;
-IN: tools.vocabs.monitor.tests
-
-[ "kernel" ] [ "core/kernel/kernel.factor" path>vocab ] unit-test
-[ "kernel" ] [ "core/kernel/" path>vocab ] unit-test
-[ "kernel" ] [ "core/kernel/" resource-path path>vocab ] unit-test
diff --git a/basis/tools/vocabs/monitor/monitor.factor b/basis/tools/vocabs/monitor/monitor.factor
deleted file mode 100644 (file)
index 1914da7..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-! Copyright (C) 2008, 2009 Slava Pestov.\r
-! See http://factorcode.org/license.txt for BSD license.\r
-USING: threads io.files io.pathnames io.monitors init kernel\r
-vocabs vocabs.loader tools.vocabs namespaces continuations\r
-sequences splitting assocs command-line concurrency.messaging\r
-io.backend sets tr accessors ;\r
-IN: tools.vocabs.monitor\r
-\r
-TR: convert-separators "/\\" ".." ;\r
-\r
-: vocab-dir>vocab-name ( path -- vocab )\r
-    trim-head-separators\r
-    trim-tail-separators\r
-    convert-separators ;\r
-\r
-: path>vocab-name ( path -- vocab )\r
-    dup ".factor" tail? [ parent-directory ] when ;\r
-\r
-: chop-vocab-root ( path -- path' )\r
-    "resource:" prepend-path normalize-path\r
-    dup vocab-roots get\r
-    [ normalize-path ] map\r
-    [ head? ] with find nip\r
-    ?head drop ;\r
-\r
-: path>vocab ( path -- vocab )\r
-    chop-vocab-root path>vocab-name vocab-dir>vocab-name ;\r
-\r
-: monitor-loop ( -- )\r
-    #! On OS X, monitors give us the full path, so we chop it\r
-    #! off if its there.\r
-    receive path>> path>vocab changed-vocab\r
-    reset-cache\r
-    monitor-loop ;\r
-\r
-: add-monitor-for-path ( path -- )\r
-    dup exists? [ t my-mailbox (monitor) ] when drop ;\r
-\r
-: monitor-thread ( -- )\r
-    [\r
-        [\r
-            vocab-roots get prune [ add-monitor-for-path ] each\r
-\r
-            H{ } clone changed-vocabs set-global\r
-            vocabs [ changed-vocab ] each\r
-\r
-            monitor-loop\r
-        ] with-monitors\r
-    ] ignore-errors ;\r
-\r
-: start-monitor-thread ( -- )\r
-    #! Silently ignore errors during monitor creation since\r
-    #! monitors are not supported on all platforms.\r
-    [ monitor-thread ] "Vocabulary monitor" spawn drop ;\r
-\r
-[\r
-    "-no-monitors" (command-line) member?\r
-    [ start-monitor-thread ] unless\r
-] "tools.vocabs.monitor" add-init-hook\r
diff --git a/basis/tools/vocabs/monitor/summary.txt b/basis/tools/vocabs/monitor/summary.txt
deleted file mode 100644 (file)
index 27c0d38..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Use io.monitors to clear tools.browser authors/tags/summary cache
diff --git a/basis/tools/vocabs/summary.txt b/basis/tools/vocabs/summary.txt
deleted file mode 100644 (file)
index 1ae5f43..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Reloading vocabularies and cross-referencing vocabularies
diff --git a/basis/tools/vocabs/vocabs-docs.factor b/basis/tools/vocabs/vocabs-docs.factor
deleted file mode 100644 (file)
index 98902f8..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-USING: help.markup help.syntax strings ;\r
-IN: tools.vocabs\r
-\r
-ARTICLE: "tools.vocabs" "Vocabulary tools"\r
-"Reloading source files changed on disk:"\r
-{ $subsection refresh }\r
-{ $subsection refresh-all }\r
-"Vocabulary summaries:"\r
-{ $subsection vocab-summary }\r
-{ $subsection set-vocab-summary }\r
-"Vocabulary tags:"\r
-{ $subsection vocab-tags }\r
-{ $subsection set-vocab-tags }\r
-{ $subsection add-vocab-tags }\r
-"Getting and setting vocabulary meta-data:"\r
-{ $subsection vocab-file-contents }\r
-{ $subsection set-vocab-file-contents }\r
-"Global meta-data:"\r
-{ $subsection all-vocabs }\r
-{ $subsection all-vocabs-seq }\r
-{ $subsection all-tags }\r
-{ $subsection all-authors }\r
-"Because loading the above data is expensive, it is cached. The cache is flushed by the " { $vocab-link "tools.vocabs.monitor" } " vocabulary. It can also be flushed manually when file system change monitors are not available:"\r
-{ $subsection reset-cache } ;\r
-\r
-ABOUT: "tools.vocabs"\r
-\r
-HELP: vocab-files\r
-{ $values { "vocab" "a vocabulary specifier" } { "seq" "a sequence of pathname strings" } }\r
-{ $description "Outputs a sequence of files comprising this vocabulary, or " { $link f } " if the vocabulary does not have a directory on disk." } ;\r
-\r
-HELP: vocab-tests\r
-{ $values { "vocab" "a vocabulary specifier" } { "tests" "a sequence of pathname strings" } }\r
-{ $description "Outputs a sequence of pathnames where the unit tests for " { $snippet "vocab" } " are located." } ;\r
-\r
-HELP: source-modified?\r
-{ $values { "path" "a pathname string" } { "?" "a boolean" } }\r
-{ $description "Tests if the source file has been modified since it was last loaded. This compares the file's CRC32 checksum of the file's contents against the previously-recorded value." } ;\r
-\r
-HELP: refresh\r
-{ $values { "prefix" string } }\r
-{ $description "Reloads source files and documentation belonging to loaded vocabularies whose names are prefixed by " { $snippet "prefix" } " which have been modified on disk." } ;\r
-\r
-HELP: refresh-all\r
-{ $description "Reloads source files and documentation for all loaded vocabularies which have been modified on disk." } ;\r
-\r
-{ refresh refresh-all } related-words\r
-\r
-HELP: vocab-file-contents\r
-{ $values { "vocab" "a vocabulary specifier" } { "name" string } { "seq" "a sequence of lines, or " { $link f } } }\r
-{ $description "Outputs the contents of the file named " { $snippet "name" } " from the vocabulary's directory, or " { $link f } " if the file does not exist." } ;\r
-\r
-HELP: set-vocab-file-contents\r
-{ $values { "seq" "a sequence of lines" } { "vocab" "a vocabulary specifier" } { "name" string } }\r
-{ $description "Stores a sequence of lines to the file named " { $snippet "name" } " from the vocabulary's directory." } ;\r
-\r
-HELP: vocab-summary\r
-{ $values { "vocab" "a vocabulary specifier" } { "summary" "a string or " { $link f } } }\r
-{ $description "Outputs a one-line string description of the vocabulary's intended purpose from the " { $snippet "summary.txt" } " file in the vocabulary's directory. Outputs " { $link f } " if the file does not exist." } ;\r
-\r
-HELP: set-vocab-summary\r
-{ $values { "string" "a string or " { $link f } } { "vocab" "a vocabulary specifier" } }\r
-{ $description "Stores a one-line string description of the vocabulary to the " { $snippet "summary.txt" } " file in the vocabulary's directory." } ;\r
-\r
-HELP: vocab-tags\r
-{ $values { "vocab" "a vocabulary specifier" } { "tags" "a sequence of strings" } }\r
-{ $description "Outputs a list of short tags classifying the vocabulary from the " { $snippet "tags.txt" } " file in the vocabulary's directory. Outputs " { $link f } " if the file does not exist." } ;\r
-\r
-HELP: set-vocab-tags\r
-{ $values { "tags" "a sequence of strings" } { "vocab" "a vocabulary specifier" } }\r
-{ $description "Stores a list of short tags classifying the vocabulary to the " { $snippet "tags.txt" } " file in the vocabulary's directory." } ;\r
-\r
-HELP: all-vocabs\r
-{ $values { "assoc" "an association list mapping vocabulary roots to sequences of vocabulary specifiers" } }\r
-{ $description "Outputs an association list of all vocabularies which have been loaded or are available for loading." } ;\r
-\r
-HELP: load-all-under\r
-{ $values { "prefix" string } }\r
-{ $description "Load all vocabularies that match the provided prefix." } ;\r
-\r
-HELP: all-vocabs-under\r
-{ $values { "prefix" string } }\r
-{ $description "Return a sequence of vocab or vocab-links for each vocab matching the provided prefix. Unlike " { $link all-child-vocabs } " this word will return both loaded and unloaded vocabularies." } ;\r
diff --git a/basis/tools/vocabs/vocabs-tests.factor b/basis/tools/vocabs/vocabs-tests.factor
deleted file mode 100644 (file)
index a4430c0..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-IN: tools.vocabs.tests
-USING: continuations namespaces tools.test tools.vocabs tools.vocabs.private ;
-
-[ ] [
-    changed-vocabs get-global
-    f changed-vocabs set-global
-    [ t ] [ "kernel" changed-vocab? ] unit-test
-    [ "kernel" changed-vocab ] [ changed-vocabs set-global ] [ ] cleanup
-] unit-test
-
-[ t ] [ "some-vocab" valid-vocab-dirname ] unit-test
-[ f ] [ ".git" valid-vocab-dirname ] unit-test
diff --git a/basis/tools/vocabs/vocabs.factor b/basis/tools/vocabs/vocabs.factor
deleted file mode 100644 (file)
index 7cd9482..0000000
+++ /dev/null
@@ -1,310 +0,0 @@
-! Copyright (C) 2007, 2008 Slava Pestov.\r
-! See http://factorcode.org/license.txt for BSD license.\r
-USING: kernel io io.styles io.files io.files.info io.directories\r
-io.pathnames io.encodings.utf8 vocabs.loader vocabs sequences\r
-namespaces make math.parser arrays hashtables assocs memoize\r
-summary sorting splitting combinators source-files debugger\r
-continuations compiler.errors init checksums checksums.crc32\r
-sets accessors generic definitions words ;\r
-IN: tools.vocabs\r
-\r
-: vocab-tests-file ( vocab -- path )\r
-    dup "-tests.factor" vocab-dir+ vocab-append-path dup\r
-    [ dup exists? [ drop f ] unless ] [ drop f ] if ;\r
-\r
-: vocab-tests-dir ( vocab -- paths )\r
-    dup vocab-dir "tests" append-path vocab-append-path dup [\r
-        dup exists? [\r
-            dup directory-files [ ".factor" tail? ] filter\r
-            [ append-path ] with map\r
-        ] [ drop f ] if\r
-    ] [ drop f ] if ;\r
-\r
-: vocab-tests ( vocab -- tests )\r
-    [\r
-        [ vocab-tests-file [ , ] when* ]\r
-        [ vocab-tests-dir [ % ] when* ] bi\r
-    ] { } make ;\r
-\r
-: vocab-files ( vocab -- seq )\r
-    [\r
-        [ vocab-source-path [ , ] when* ]\r
-        [ vocab-docs-path [ , ] when* ]\r
-        [ vocab-tests % ] tri\r
-    ] { } make ;\r
-\r
-: vocab-heading. ( vocab -- )\r
-    nl\r
-    "==== " write\r
-    [ vocab-name ] [ vocab write-object ] bi ":" print\r
-    nl ;\r
-\r
-: load-error. ( triple -- )\r
-    [ first vocab-heading. ] [ second print-error ] bi ;\r
-\r
-: load-failures. ( failures -- )\r
-    [ load-error. nl ] each ;\r
-\r
-SYMBOL: failures\r
-\r
-: require-all ( vocabs -- failures )\r
-    [\r
-        V{ } clone blacklist set\r
-        V{ } clone failures set\r
-        [\r
-            [ require ]\r
-            [ swap vocab-name failures get set-at ]\r
-            recover\r
-        ] each\r
-        failures get\r
-    ] with-scope ;\r
-\r
-: source-modified? ( path -- ? )\r
-    dup source-files get at [\r
-        dup path>>\r
-        dup exists? [\r
-            utf8 file-lines crc32 checksum-lines\r
-            swap checksum>> = not\r
-        ] [\r
-            2drop f\r
-        ] if\r
-    ] [\r
-        exists?\r
-    ] ?if ;\r
-\r
-SYMBOL: changed-vocabs\r
-\r
-: changed-vocab ( vocab -- )\r
-    dup vocab changed-vocabs get and\r
-    [ dup changed-vocabs get set-at ] [ drop ] if ;\r
-\r
-: unchanged-vocab ( vocab -- )\r
-    changed-vocabs get delete-at ;\r
-\r
-: unchanged-vocabs ( vocabs -- )\r
-    [ unchanged-vocab ] each ;\r
-\r
-: changed-vocab? ( vocab -- ? )\r
-    changed-vocabs get dup [ key? ] [ 2drop t ] if ;\r
-\r
-: filter-changed ( vocabs -- vocabs' )\r
-    [ changed-vocab? ] filter ;\r
-\r
-SYMBOL: modified-sources\r
-SYMBOL: modified-docs\r
-\r
-: (to-refresh) ( vocab variable loaded? path -- )\r
-    dup [\r
-        swap [\r
-            pick changed-vocab? [\r
-                source-modified? [ get push ] [ 2drop ] if\r
-            ] [ 3drop ] if\r
-        ] [ drop get push ] if\r
-    ] [ 2drop 2drop ] if ;\r
-\r
-: to-refresh ( prefix -- modified-sources modified-docs unchanged )\r
-    [\r
-        V{ } clone modified-sources set\r
-        V{ } clone modified-docs set\r
-\r
-        child-vocabs [\r
-            [\r
-                [\r
-                    [ modified-sources ]\r
-                    [ vocab source-loaded?>> ]\r
-                    [ vocab-source-path ]\r
-                    tri (to-refresh)\r
-                ] [\r
-                    [ modified-docs ]\r
-                    [ vocab docs-loaded?>> ]\r
-                    [ vocab-docs-path ]\r
-                    tri (to-refresh)\r
-                ] bi\r
-            ] each\r
-\r
-            modified-sources get\r
-            modified-docs get\r
-        ]\r
-        [ modified-docs get modified-sources get append diff ] bi\r
-    ] with-scope ;\r
-\r
-: do-refresh ( modified-sources modified-docs unchanged -- )\r
-    unchanged-vocabs\r
-    [\r
-        [ [ vocab f >>source-loaded? drop ] each ]\r
-        [ [ vocab f >>docs-loaded? drop ] each ] bi*\r
-    ]\r
-    [\r
-        append prune\r
-        [ unchanged-vocabs ]\r
-        [ require-all load-failures. ] bi\r
-    ] 2bi ;\r
-\r
-: refresh ( prefix -- ) to-refresh do-refresh ;\r
-\r
-: refresh-all ( -- ) "" refresh ;\r
-\r
-MEMO: vocab-file-contents ( vocab name -- seq )\r
-    vocab-append-path dup\r
-    [ dup exists? [ utf8 file-lines ] [ drop f ] if ] when ;\r
-\r
-: set-vocab-file-contents ( seq vocab name -- )\r
-    dupd vocab-append-path [\r
-        utf8 set-file-lines\r
-        \ vocab-file-contents reset-memoized\r
-    ] [\r
-        "The " swap vocab-name\r
-        " vocabulary was not loaded from the file system"\r
-        3append throw\r
-    ] ?if ;\r
-\r
-: vocab-summary-path ( vocab -- string )\r
-    vocab-dir "summary.txt" append-path ;\r
-\r
-: vocab-summary ( vocab -- summary )\r
-    dup dup vocab-summary-path vocab-file-contents\r
-    [\r
-        vocab-name " vocabulary" append\r
-    ] [\r
-        nip first\r
-    ] if-empty ;\r
-\r
-M: vocab summary\r
-    [\r
-        dup vocab-summary %\r
-        " (" %\r
-        words>> assoc-size #\r
-        " words)" %\r
-    ] "" make ;\r
-\r
-M: vocab-link summary vocab-summary ;\r
-\r
-: set-vocab-summary ( string vocab -- )\r
-    [ 1array ] dip\r
-    dup vocab-summary-path\r
-    set-vocab-file-contents ;\r
-\r
-: vocab-tags-path ( vocab -- string )\r
-    vocab-dir "tags.txt" append-path ;\r
-\r
-: vocab-tags ( vocab -- tags )\r
-    dup vocab-tags-path vocab-file-contents harvest ;\r
-\r
-: set-vocab-tags ( tags vocab -- )\r
-    dup vocab-tags-path set-vocab-file-contents ;\r
-\r
-: add-vocab-tags ( tags vocab -- )\r
-    [ vocab-tags append prune ] keep set-vocab-tags ;\r
-\r
-: vocab-authors-path ( vocab -- string )\r
-    vocab-dir "authors.txt" append-path ;\r
-\r
-: vocab-authors ( vocab -- authors )\r
-    dup vocab-authors-path vocab-file-contents harvest ;\r
-\r
-: set-vocab-authors ( authors vocab -- )\r
-    dup vocab-authors-path set-vocab-file-contents ;\r
-\r
-\r
-<PRIVATE\r
-: valid-vocab-dirname ( dirname -- ? )\r
-    dup empty? [ drop f ] [ first CHAR: . = not ] if ;\r
-PRIVATE>\r
-\r
-: vocab-subdirs ( dir -- dirs )\r
-    [\r
-        [ [ link-info directory? ] [ valid-vocab-dirname ] bi and ] filter\r
-    ] with-directory-files natural-sort ;\r
-\r
-: (all-child-vocabs) ( root name -- vocabs )\r
-    [\r
-        vocab-dir append-path dup exists?\r
-        [ vocab-subdirs ] [ drop { } ] if\r
-    ] keep [\r
-        swap [ "." glue ] with map\r
-    ] unless-empty ;\r
-\r
-: vocab-dir? ( root name -- ? )\r
-    over\r
-    [ ".factor" vocab-dir+ append-path exists? ]\r
-    [ 2drop f ]\r
-    if ;\r
-\r
-: vocabs-in-dir ( root name -- )\r
-    dupd (all-child-vocabs) [\r
-        2dup vocab-dir? [ dup >vocab-link , ] when\r
-        vocabs-in-dir\r
-    ] with each ;\r
-\r
-: all-vocabs ( -- assoc )\r
-    vocab-roots get [\r
-        dup [ "" vocabs-in-dir ] { } make\r
-    ] { } map>assoc ;\r
-\r
-: all-vocabs-under ( prefix -- vocabs )\r
-    [\r
-        vocab-roots get [ over vocabs-in-dir ] each drop\r
-    ] { } make ;\r
-\r
-MEMO: all-vocabs-seq ( -- seq )\r
-    all-vocabs values concat ;\r
-\r
-: unportable? ( name -- ? )\r
-    vocab-tags "unportable" swap member? ;\r
-\r
-: filter-unportable ( seq -- seq' )\r
-    [ vocab-name unportable? not ] filter ;\r
-\r
-: try-everything ( -- failures )\r
-    all-vocabs-seq\r
-    filter-unportable\r
-    require-all ;\r
-\r
-: load-everything ( -- )\r
-    try-everything load-failures. ;\r
-\r
-: load-all-under ( prefix -- )\r
-    all-vocabs-under filter-unportable require-all load-failures. ;\r
-\r
-: unrooted-child-vocabs ( prefix -- seq )\r
-    dup empty? [ CHAR: . suffix ] unless\r
-    vocabs\r
-    [ find-vocab-root not ] filter\r
-    [\r
-        vocab-name swap ?head CHAR: . rot member? not and\r
-    ] with filter\r
-    [ vocab ] map ;\r
-\r
-: all-child-vocabs ( prefix -- assoc )\r
-    vocab-roots get [\r
-        dup pick (all-child-vocabs) [ >vocab-link ] map\r
-    ] { } map>assoc\r
-    swap unrooted-child-vocabs f swap 2array suffix ;\r
-\r
-: all-child-vocabs-seq ( prefix -- assoc )\r
-    vocab-roots get swap [\r
-        dupd (all-child-vocabs)\r
-        [ vocab-dir? ] with filter\r
-    ] curry map concat ;\r
-\r
-MEMO: all-tags ( -- seq )\r
-    all-vocabs-seq [ vocab-tags ] gather natural-sort ;\r
-\r
-MEMO: all-authors ( -- seq )\r
-    all-vocabs-seq [ vocab-authors ] gather natural-sort ;\r
-\r
-: reset-cache ( -- )\r
-    root-cache get-global clear-assoc\r
-    \ vocab-file-contents reset-memoized\r
-    \ all-vocabs-seq reset-memoized\r
-    \ all-authors reset-memoized\r
-    \ all-tags reset-memoized ;\r
-\r
-SINGLETON: cache-observer\r
-\r
-M: cache-observer vocabs-changed drop reset-cache ;\r
-\r
-[\r
-    f changed-vocabs set-global\r
-    cache-observer add-vocab-observer\r
-] "tools.vocabs" add-init-hook
\ No newline at end of file
index eb8823b10781803c1b40db4b0632b2266780ad38..cf5493f33dd271b53d49f9115b8bfba99857e9d7 100644 (file)
@@ -4,7 +4,8 @@ USING: alien.syntax cocoa cocoa.nibs cocoa.application
 cocoa.classes cocoa.dialogs cocoa.pasteboard cocoa.subclassing
 core-foundation core-foundation.strings help.topics kernel
 memory namespaces parser system ui ui.tools.browser
-ui.tools.listener ui.backend.cocoa eval locals tools.vocabs ;
+ui.tools.listener ui.backend.cocoa eval locals
+vocabs.refresh ;
 IN: ui.backend.cocoa.tools
 
 : finder-run-files ( alien -- )
index ec4fc80a4df3a772150b8589d37e199d02db1962..998020c9c455cde73ff4bd0f7509bdcada4da218 100644 (file)
@@ -1,7 +1,7 @@
 USING: help.markup help.syntax ui.commands ui.operations
 ui.gadgets.editors ui.gadgets.panes listener io words
 ui.tools.listener.completion ui.tools.common help.tips
-tools.vocabs vocabs ;
+vocabs vocabs.refresh ;
 IN: ui.tools.listener
 
 HELP: interactor
index eca16e72862ca1db9b1ca9f1d62c1f48f1360efb..6ed3577a064dcce326cbdb91ae49df753868a549 100644 (file)
@@ -6,14 +6,15 @@ compiler.units help.tips concurrency.flags concurrency.mailboxes
 continuations destructors documents documents.elements fry hashtables
 help help.markup io io.styles kernel lexer listener math models sets
 models.delay models.arrow namespaces parser prettyprint quotations
-sequences strings threads tools.vocabs vocabs vocabs.loader
+sequences strings threads vocabs vocabs.refresh vocabs.loader
 vocabs.parser words debugger ui ui.commands ui.pens.solid ui.gadgets
 ui.gadgets.glass ui.gadgets.buttons ui.gadgets.editors
 ui.gadgets.labeled ui.gadgets.panes ui.gadgets.scrollers
 ui.gadgets.status-bar ui.gadgets.tracks ui.gadgets.borders ui.gestures
 ui.operations ui.tools.browser ui.tools.common ui.tools.debugger
 ui.tools.listener.completion ui.tools.listener.popups
-ui.tools.listener.history ui.images ui.tools.error-list tools.errors.model ;
+ui.tools.listener.history ui.images ui.tools.error-list
+tools.errors.model ;
 FROM: source-files.errors => all-errors ;
 IN: ui.tools.listener
 
index 3c160118978f7e10a67599a7a32490740d04fc8b..650d751ee29d741fb323d2324011f50a0cb8cd57 100644 (file)
@@ -4,7 +4,7 @@ USING: continuations definitions generic help.topics threads
 stack-checker summary io.pathnames io.styles kernel namespaces parser
 prettyprint quotations tools.crossref tools.annotations editors
 tools.profiler tools.test tools.time tools.walker vocabs vocabs.loader
-words sequences tools.vocabs classes compiler.errors compiler.units
+words sequences classes compiler.errors compiler.units
 accessors vocabs.parser macros.expander ui ui.tools.browser
 ui.tools.listener ui.tools.listener.completion ui.tools.profiler
 ui.tools.inspector ui.tools.traceback ui.commands ui.gadgets.editors
index c825c60dbb78bab21db794dfab4048a1c5e73698..7ea34e651fc5639c3be1543b3702ea89f5134e8d 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: memory system kernel tools.vocabs ui.tools.operations
+USING: memory system kernel vocabs.refresh ui.tools.operations
 ui.tools.listener ui.tools.browser ui.tools.common ui.tools.error-list
 ui.tools.walker ui.commands ui.gestures ui ui.private ;
 IN: ui.tools
diff --git a/basis/vocabs/cache/authors.txt b/basis/vocabs/cache/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/vocabs/cache/cache.factor b/basis/vocabs/cache/cache.factor
new file mode 100644 (file)
index 0000000..63a8d6d
--- /dev/null
@@ -0,0 +1,21 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: assocs kernel namespaces memoize init vocabs
+vocabs.hierarchy vocabs.loader vocabs.metadata vocabs.refresh ;
+IN: vocabs.cache
+
+: reset-cache ( -- )
+    root-cache get-global clear-assoc
+    \ vocab-file-contents reset-memoized
+    \ all-vocabs-seq reset-memoized
+    \ all-authors reset-memoized
+    \ all-tags reset-memoized ;
+
+SINGLETON: cache-observer
+
+M: cache-observer vocabs-changed drop reset-cache ;
+
+[
+    f changed-vocabs set-global
+    cache-observer add-vocab-observer
+] "vocabs.cache" add-init-hook
\ No newline at end of file
diff --git a/basis/vocabs/cache/summary.txt b/basis/vocabs/cache/summary.txt
new file mode 100644 (file)
index 0000000..92ab1fe
--- /dev/null
@@ -0,0 +1 @@
+Caching vocabulary data from disk
diff --git a/basis/vocabs/errors/authors.txt b/basis/vocabs/errors/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/vocabs/errors/errors.factor b/basis/vocabs/errors/errors.factor
new file mode 100644 (file)
index 0000000..8f88eb3
--- /dev/null
@@ -0,0 +1,35 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: assocs continuations debugger io io.styles kernel
+namespaces sequences vocabs vocabs.loader ;
+IN: vocabs.errors
+
+<PRIVATE
+
+: vocab-heading. ( vocab -- )
+    nl
+    "==== " write
+    [ vocab-name ] [ vocab write-object ] bi ":" print
+    nl ;
+
+: load-error. ( triple -- )
+    [ first vocab-heading. ] [ second print-error ] bi ;
+
+SYMBOL: failures
+
+PRIVATE>
+
+: load-failures. ( failures -- )
+    [ load-error. nl ] each ;
+
+: require-all ( vocabs -- failures )
+    [
+        V{ } clone blacklist set
+        V{ } clone failures set
+        [
+            [ require ]
+            [ swap vocab-name failures get set-at ]
+            recover
+        ] each
+        failures get
+    ] with-scope ;
\ No newline at end of file
diff --git a/basis/vocabs/errors/summary.txt b/basis/vocabs/errors/summary.txt
new file mode 100644 (file)
index 0000000..b7e7040
--- /dev/null
@@ -0,0 +1 @@
+Loading vocabularies and batching errors
diff --git a/basis/vocabs/files/authors.txt b/basis/vocabs/files/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/vocabs/files/files-docs.factor b/basis/vocabs/files/files-docs.factor
new file mode 100644 (file)
index 0000000..e2c6a5f
--- /dev/null
@@ -0,0 +1,11 @@
+USING: help.markup help.syntax strings ;
+IN: vocabs.files
+
+HELP: vocab-files
+{ $values { "vocab" "a vocabulary specifier" } { "seq" "a sequence of pathname strings" } }
+{ $description "Outputs a sequence of files comprising this vocabulary, or " { $link f } " if the vocabulary does not have a directory on disk." } ;
+
+HELP: vocab-tests
+{ $values { "vocab" "a vocabulary specifier" } { "tests" "a sequence of pathname strings" } }
+{ $description "Outputs a sequence of pathnames where the unit tests for " { $snippet "vocab" } " are located." } ;
+
diff --git a/basis/vocabs/files/files.factor b/basis/vocabs/files/files.factor
new file mode 100644 (file)
index 0000000..c1d7dcf
--- /dev/null
@@ -0,0 +1,34 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.directories io.files io.pathnames kernel make
+sequences vocabs.loader ;
+IN: vocabs.files
+
+<PRIVATE
+
+: vocab-tests-file ( vocab -- path )
+    dup "-tests.factor" vocab-dir+ vocab-append-path dup
+    [ dup exists? [ drop f ] unless ] [ drop f ] if ;
+
+: vocab-tests-dir ( vocab -- paths )
+    dup vocab-dir "tests" append-path vocab-append-path dup [
+        dup exists? [
+            dup directory-files [ ".factor" tail? ] filter
+            [ append-path ] with map
+        ] [ drop f ] if
+    ] [ drop f ] if ;
+
+PRIVATE>
+
+: vocab-tests ( vocab -- tests )
+    [
+        [ vocab-tests-file [ , ] when* ]
+        [ vocab-tests-dir [ % ] when* ] bi
+    ] { } make ;
+
+: vocab-files ( vocab -- seq )
+    [
+        [ vocab-source-path [ , ] when* ]
+        [ vocab-docs-path [ , ] when* ]
+        [ vocab-tests % ] tri
+    ] { } make ;
\ No newline at end of file
diff --git a/basis/vocabs/files/summary.txt b/basis/vocabs/files/summary.txt
new file mode 100644 (file)
index 0000000..b1633e3
--- /dev/null
@@ -0,0 +1 @@
+Getting a list of files in a vocabulary
diff --git a/basis/vocabs/hierarchy/hierarchy-docs.factor b/basis/vocabs/hierarchy/hierarchy-docs.factor
new file mode 100644 (file)
index 0000000..c5d8554
--- /dev/null
@@ -0,0 +1,33 @@
+USING: help.markup help.syntax strings vocabs.loader ;\r
+IN: vocabs.hierarchy\r
+\r
+ARTICLE: "vocabs.hierarchy" "Vocabulary hierarchy tools"\r
+"These tools operate on all vocabularies found in the current set of " { $link vocab-roots } ", loaded or not."\r
+$nl\r
+"Loading vocabulary hierarchies:"\r
+{ $subsection load }\r
+{ $subsection load-all }\r
+"Getting all vocabularies on disk:"\r
+{ $subsection all-vocabs }\r
+{ $subsection all-vocabs-seq }\r
+"Getting " { $link "vocabs.metadata" } " for all vocabularies on disk:"\r
+{ $subsection all-tags }\r
+{ $subsection all-authors } ;\r
+\r
+ABOUT: "vocabs.hierarchy"\r
+\r
+HELP: all-vocabs\r
+{ $values { "assoc" "an association list mapping vocabulary roots to sequences of vocabulary specifiers" } }\r
+{ $description "Outputs an association list of all vocabularies which have been loaded or are available for loading." } ;\r
+\r
+HELP: load\r
+{ $values { "prefix" string } }\r
+{ $description "Load all vocabularies that match the provided prefix." }\r
+{ $notes "This word differs from " { $link require } " in that it loads all subvocabularies, not just the given one." } ;\r
+\r
+HELP: load-all\r
+{ $description "Load all vocabularies in the source tree." } ;\r
+\r
+HELP: all-vocabs-under\r
+{ $values { "prefix" string } }\r
+{ $description "Return a sequence of vocab or vocab-links for each vocab matching the provided prefix. Unlike " { $link all-child-vocabs } " this word will return both loaded and unloaded vocabularies." } ;\r
diff --git a/basis/vocabs/hierarchy/hierarchy-tests.factor b/basis/vocabs/hierarchy/hierarchy-tests.factor
new file mode 100644 (file)
index 0000000..acbae80
--- /dev/null
@@ -0,0 +1,12 @@
+IN: vocabs.hierarchy.tests
+USING: continuations namespaces tools.test vocabs.hierarchy vocabs.hierarchy.private ;
+
+[ ] [
+    changed-vocabs get-global
+    f changed-vocabs set-global
+    [ t ] [ "kernel" changed-vocab? ] unit-test
+    [ "kernel" changed-vocab ] [ changed-vocabs set-global ] [ ] cleanup
+] unit-test
+
+[ t ] [ "some-vocab" valid-vocab-dirname ] unit-test
+[ f ] [ ".git" valid-vocab-dirname ] unit-test
diff --git a/basis/vocabs/hierarchy/hierarchy.factor b/basis/vocabs/hierarchy/hierarchy.factor
new file mode 100644 (file)
index 0000000..046ccb8
--- /dev/null
@@ -0,0 +1,99 @@
+! Copyright (C) 2007, 2009 Slava Pestov.\r
+! See http://factorcode.org/license.txt for BSD license.\r
+USING: arrays assocs combinators.short-circuit fry\r
+io.directories io.files io.files.info io.pathnames kernel make\r
+memoize namespaces sequences sorting splitting vocabs sets\r
+vocabs.loader vocabs.metadata vocabs.errors ;\r
+IN: vocabs.hierarchy\r
+\r
+<PRIVATE\r
+\r
+: vocab-subdirs ( dir -- dirs )\r
+    [\r
+        [\r
+            { [ link-info directory? ] [ "." head? not ] } 1&&\r
+        ] filter\r
+    ] with-directory-files natural-sort ;\r
+\r
+: (all-child-vocabs) ( root name -- vocabs )\r
+    [\r
+        vocab-dir append-path dup exists?\r
+        [ vocab-subdirs ] [ drop { } ] if\r
+    ] keep\r
+    [ '[ [ _ "." ] dip 3append ] map ] unless-empty ;\r
+\r
+: vocab-dir? ( root name -- ? )\r
+    over\r
+    [ ".factor" vocab-dir+ append-path exists? ]\r
+    [ 2drop f ]\r
+    if ;\r
+\r
+: vocabs-in-dir ( root name -- )\r
+    dupd (all-child-vocabs) [\r
+        2dup vocab-dir? [ dup >vocab-link , ] when\r
+        vocabs-in-dir\r
+    ] with each ;\r
+\r
+PRIVATE>\r
+\r
+: all-vocabs ( -- assoc )\r
+    vocab-roots get [\r
+        dup [ "" vocabs-in-dir ] { } make\r
+    ] { } map>assoc ;\r
+\r
+: all-vocabs-under ( prefix -- vocabs )\r
+    [\r
+        [ vocab-roots get ] dip '[ _ vocabs-in-dir ] each\r
+    ] { } make ;\r
+\r
+MEMO: all-vocabs-seq ( -- seq )\r
+    "" all-vocabs-under ;\r
+\r
+<PRIVATE\r
+\r
+: unrooted-child-vocabs ( prefix -- seq )\r
+    dup empty? [ CHAR: . suffix ] unless\r
+    vocabs\r
+    [ find-vocab-root not ] filter\r
+    [\r
+        vocab-name swap ?head CHAR: . rot member? not and\r
+    ] with filter\r
+    [ vocab ] map ;\r
+\r
+PRIVATE>\r
+\r
+: all-child-vocabs ( prefix -- assoc )\r
+    vocab-roots get [\r
+        dup pick (all-child-vocabs) [ >vocab-link ] map\r
+    ] { } map>assoc\r
+    swap unrooted-child-vocabs f swap 2array suffix ;\r
+\r
+: all-child-vocabs-seq ( prefix -- assoc )\r
+    vocab-roots get swap '[\r
+        dup _ (all-child-vocabs)\r
+        [ vocab-dir? ] with filter\r
+    ] map concat ;\r
+\r
+<PRIVATE\r
+\r
+: filter-unportable ( seq -- seq' )\r
+    [ vocab-name unportable? not ] filter ;\r
+\r
+PRIVATE>\r
+\r
+: (load) ( prefix -- failures )\r
+    all-vocabs-under\r
+    filter-unportable\r
+    require-all ;\r
+\r
+: load ( prefix -- )\r
+    (load) load-failures. ;\r
+\r
+: load-all ( -- )\r
+    "" load ;\r
+\r
+MEMO: all-tags ( -- seq )\r
+    all-vocabs-seq [ vocab-tags ] gather natural-sort ;\r
+\r
+MEMO: all-authors ( -- seq )\r
+    all-vocabs-seq [ vocab-authors ] gather natural-sort ;
\ No newline at end of file
diff --git a/basis/vocabs/hierarchy/summary.txt b/basis/vocabs/hierarchy/summary.txt
new file mode 100644 (file)
index 0000000..b8d9315
--- /dev/null
@@ -0,0 +1 @@
+Searching for vocabularies on disk
diff --git a/basis/vocabs/metadata/authors.txt b/basis/vocabs/metadata/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/vocabs/metadata/metadata-docs.factor b/basis/vocabs/metadata/metadata-docs.factor
new file mode 100644 (file)
index 0000000..002f853
--- /dev/null
@@ -0,0 +1,44 @@
+USING: help.markup help.syntax strings ;
+IN: vocabs.metadata
+
+ARTICLE: "vocabs.metadata" "Vocabulary metadata"
+"Vocabulary summaries:"
+{ $subsection vocab-summary }
+{ $subsection set-vocab-summary }
+"Vocabulary authors:"
+{ $subsection vocab-authors }
+{ $subsection set-vocab-authors }
+"Vocabulary tags:"
+{ $subsection vocab-tags }
+{ $subsection set-vocab-tags }
+{ $subsection add-vocab-tags }
+"Getting and setting arbitrary vocabulary metadata:"
+{ $subsection vocab-file-contents }
+{ $subsection set-vocab-file-contents } ;
+
+ABOUT: "vocabs.metadata"
+
+HELP: vocab-file-contents
+{ $values { "vocab" "a vocabulary specifier" } { "name" string } { "seq" "a sequence of lines, or " { $link f } } }
+{ $description "Outputs the contents of the file named " { $snippet "name" } " from the vocabulary's directory, or " { $link f } " if the file does not exist." } ;
+
+HELP: set-vocab-file-contents
+{ $values { "seq" "a sequence of lines" } { "vocab" "a vocabulary specifier" } { "name" string } }
+{ $description "Stores a sequence of lines to the file named " { $snippet "name" } " from the vocabulary's directory." } ;
+
+HELP: vocab-summary
+{ $values { "vocab" "a vocabulary specifier" } { "summary" "a string or " { $link f } } }
+{ $description "Outputs a one-line string description of the vocabulary's intended purpose from the " { $snippet "summary.txt" } " file in the vocabulary's directory. Outputs " { $link f } " if the file does not exist." } ;
+
+HELP: set-vocab-summary
+{ $values { "string" "a string or " { $link f } } { "vocab" "a vocabulary specifier" } }
+{ $description "Stores a one-line string description of the vocabulary to the " { $snippet "summary.txt" } " file in the vocabulary's directory." } ;
+
+HELP: vocab-tags
+{ $values { "vocab" "a vocabulary specifier" } { "tags" "a sequence of strings" } }
+{ $description "Outputs a list of short tags classifying the vocabulary from the " { $snippet "tags.txt" } " file in the vocabulary's directory. Outputs " { $link f } " if the file does not exist." } ;
+
+HELP: set-vocab-tags
+{ $values { "tags" "a sequence of strings" } { "vocab" "a vocabulary specifier" } }
+{ $description "Stores a list of short tags classifying the vocabulary to the " { $snippet "tags.txt" } " file in the vocabulary's directory." } ;
+
diff --git a/basis/vocabs/metadata/metadata.factor b/basis/vocabs/metadata/metadata.factor
new file mode 100644 (file)
index 0000000..85a503c
--- /dev/null
@@ -0,0 +1,70 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors arrays assocs io.encodings.utf8 io.files
+io.pathnames kernel make math.parser memoize sequences sets
+sorting summary vocabs vocabs.loader ;
+IN: vocabs.metadata
+
+MEMO: vocab-file-contents ( vocab name -- seq )
+    vocab-append-path dup
+    [ dup exists? [ utf8 file-lines ] [ drop f ] if ] when ;
+
+: set-vocab-file-contents ( seq vocab name -- )
+    dupd vocab-append-path [
+        utf8 set-file-lines
+        \ vocab-file-contents reset-memoized
+    ] [
+        "The " swap vocab-name
+        " vocabulary was not loaded from the file system"
+        3append throw
+    ] ?if ;
+
+: vocab-summary-path ( vocab -- string )
+    vocab-dir "summary.txt" append-path ;
+
+: vocab-summary ( vocab -- summary )
+    dup dup vocab-summary-path vocab-file-contents
+    [
+        vocab-name " vocabulary" append
+    ] [
+        nip first
+    ] if-empty ;
+
+M: vocab summary
+    [
+        dup vocab-summary %
+        " (" %
+        words>> assoc-size #
+        " words)" %
+    ] "" make ;
+
+M: vocab-link summary vocab-summary ;
+
+: set-vocab-summary ( string vocab -- )
+    [ 1array ] dip
+    dup vocab-summary-path
+    set-vocab-file-contents ;
+
+: vocab-tags-path ( vocab -- string )
+    vocab-dir "tags.txt" append-path ;
+
+: vocab-tags ( vocab -- tags )
+    dup vocab-tags-path vocab-file-contents harvest ;
+
+: set-vocab-tags ( tags vocab -- )
+    dup vocab-tags-path set-vocab-file-contents ;
+
+: add-vocab-tags ( tags vocab -- )
+    [ vocab-tags append prune ] keep set-vocab-tags ;
+
+: vocab-authors-path ( vocab -- string )
+    vocab-dir "authors.txt" append-path ;
+
+: vocab-authors ( vocab -- authors )
+    dup vocab-authors-path vocab-file-contents harvest ;
+
+: set-vocab-authors ( authors vocab -- )
+    dup vocab-authors-path set-vocab-file-contents ;
+
+: unportable? ( vocab -- ? )
+    vocab-tags "unportable" swap member? ;
\ No newline at end of file
diff --git a/basis/vocabs/metadata/summary.txt b/basis/vocabs/metadata/summary.txt
new file mode 100644 (file)
index 0000000..eec7fd5
--- /dev/null
@@ -0,0 +1 @@
+Managing vocabulary author, tag and summary information
diff --git a/basis/vocabs/refresh/authors.txt b/basis/vocabs/refresh/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/vocabs/refresh/monitor/authors.txt b/basis/vocabs/refresh/monitor/authors.txt
new file mode 100644 (file)
index 0000000..1901f27
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
diff --git a/basis/vocabs/refresh/monitor/monitor-tests.factor b/basis/vocabs/refresh/monitor/monitor-tests.factor
new file mode 100644 (file)
index 0000000..8609118
--- /dev/null
@@ -0,0 +1,6 @@
+USING: tools.test vocabs.refresh.monitor io.pathnames ;
+IN: vocabs.refresh.monitor.tests
+
+[ "kernel" ] [ "core/kernel/kernel.factor" path>vocab ] unit-test
+[ "kernel" ] [ "core/kernel/" path>vocab ] unit-test
+[ "kernel" ] [ "core/kernel/" resource-path path>vocab ] unit-test
diff --git a/basis/vocabs/refresh/monitor/monitor.factor b/basis/vocabs/refresh/monitor/monitor.factor
new file mode 100644 (file)
index 0000000..1445b9f
--- /dev/null
@@ -0,0 +1,59 @@
+! Copyright (C) 2008, 2009 Slava Pestov.\r
+! See http://factorcode.org/license.txt for BSD license.\r
+USING: accessors assocs command-line concurrency.messaging\r
+continuations init io.backend io.files io.monitors io.pathnames\r
+kernel namespaces sequences sets splitting threads\r
+tr vocabs vocabs.loader vocabs.refresh vocabs.cache ;\r
+IN: vocabs.refresh.monitor\r
+\r
+TR: convert-separators "/\\" ".." ;\r
+\r
+: vocab-dir>vocab-name ( path -- vocab )\r
+    trim-head-separators\r
+    trim-tail-separators\r
+    convert-separators ;\r
+\r
+: path>vocab-name ( path -- vocab )\r
+    dup ".factor" tail? [ parent-directory ] when ;\r
+\r
+: chop-vocab-root ( path -- path' )\r
+    "resource:" prepend-path normalize-path\r
+    dup vocab-roots get\r
+    [ normalize-path ] map\r
+    [ head? ] with find nip\r
+    ?head drop ;\r
+\r
+: path>vocab ( path -- vocab )\r
+    chop-vocab-root path>vocab-name vocab-dir>vocab-name ;\r
+\r
+: monitor-loop ( -- )\r
+    #! On OS X, monitors give us the full path, so we chop it\r
+    #! off if its there.\r
+    receive path>> path>vocab changed-vocab\r
+    reset-cache\r
+    monitor-loop ;\r
+\r
+: add-monitor-for-path ( path -- )\r
+    dup exists? [ t my-mailbox (monitor) ] when drop ;\r
+\r
+: monitor-thread ( -- )\r
+    [\r
+        [\r
+            vocab-roots get prune [ add-monitor-for-path ] each\r
+\r
+            H{ } clone changed-vocabs set-global\r
+            vocabs [ changed-vocab ] each\r
+\r
+            monitor-loop\r
+        ] with-monitors\r
+    ] ignore-errors ;\r
+\r
+: start-monitor-thread ( -- )\r
+    #! Silently ignore errors during monitor creation since\r
+    #! monitors are not supported on all platforms.\r
+    [ monitor-thread ] "Vocabulary monitor" spawn drop ;\r
+\r
+[\r
+    "-no-monitors" (command-line) member?\r
+    [ start-monitor-thread ] unless\r
+] "vocabs.refresh.monitor" add-init-hook\r
diff --git a/basis/vocabs/refresh/monitor/summary.txt b/basis/vocabs/refresh/monitor/summary.txt
new file mode 100644 (file)
index 0000000..27c0d38
--- /dev/null
@@ -0,0 +1 @@
+Use io.monitors to clear tools.browser authors/tags/summary cache
diff --git a/basis/vocabs/refresh/refresh-docs.factor b/basis/vocabs/refresh/refresh-docs.factor
new file mode 100644 (file)
index 0000000..5652d2a
--- /dev/null
@@ -0,0 +1,22 @@
+USING: help.markup help.syntax strings ;
+IN: vocabs.refresh
+
+HELP: source-modified?
+{ $values { "path" "a pathname string" } { "?" "a boolean" } }
+{ $description "Tests if the source file has been modified since it was last loaded. This compares the file's CRC32 checksum of the file's contents against the previously-recorded value." } ;
+
+HELP: refresh
+{ $values { "prefix" string } }
+{ $description "Reloads source files and documentation belonging to loaded vocabularies whose names are prefixed by " { $snippet "prefix" } " which have been modified on disk." } ;
+
+HELP: refresh-all
+{ $description "Reloads source files and documentation for all loaded vocabularies which have been modified on disk." } ;
+
+{ refresh refresh-all } related-words
+
+ARTICLE: "vocabs.refresh" "Runtime code reloading"
+"Reloading source files changed on disk:"
+{ $subsection refresh }
+{ $subsection refresh-all } ;
+
+ABOUT: "vocabs.refresh"
diff --git a/basis/vocabs/refresh/refresh.factor b/basis/vocabs/refresh/refresh.factor
new file mode 100644 (file)
index 0000000..9ec89e3
--- /dev/null
@@ -0,0 +1,91 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors assocs checksums checksums.crc32
+io.encodings.utf8 io.files kernel namespaces sequences sets
+source-files vocabs vocabs.errors vocabs.loader ;
+IN: vocabs.refresh
+
+: source-modified? ( path -- ? )
+    dup source-files get at [
+        dup path>>
+        dup exists? [
+            utf8 file-lines crc32 checksum-lines
+            swap checksum>> = not
+        ] [
+            2drop f
+        ] if
+    ] [
+        exists?
+    ] ?if ;
+
+SYMBOL: changed-vocabs
+
+: changed-vocab ( vocab -- )
+    dup vocab changed-vocabs get and
+    [ dup changed-vocabs get set-at ] [ drop ] if ;
+
+: unchanged-vocab ( vocab -- )
+    changed-vocabs get delete-at ;
+
+: unchanged-vocabs ( vocabs -- )
+    [ unchanged-vocab ] each ;
+
+: changed-vocab? ( vocab -- ? )
+    changed-vocabs get dup [ key? ] [ 2drop t ] if ;
+
+: filter-changed ( vocabs -- vocabs' )
+    [ changed-vocab? ] filter ;
+
+SYMBOL: modified-sources
+SYMBOL: modified-docs
+
+: (to-refresh) ( vocab variable loaded? path -- )
+    dup [
+        swap [
+            pick changed-vocab? [
+                source-modified? [ get push ] [ 2drop ] if
+            ] [ 3drop ] if
+        ] [ drop get push ] if
+    ] [ 2drop 2drop ] if ;
+
+: to-refresh ( prefix -- modified-sources modified-docs unchanged )
+    [
+        V{ } clone modified-sources set
+        V{ } clone modified-docs set
+
+        child-vocabs [
+            [
+                [
+                    [ modified-sources ]
+                    [ vocab source-loaded?>> ]
+                    [ vocab-source-path ]
+                    tri (to-refresh)
+                ] [
+                    [ modified-docs ]
+                    [ vocab docs-loaded?>> ]
+                    [ vocab-docs-path ]
+                    tri (to-refresh)
+                ] bi
+            ] each
+
+            modified-sources get
+            modified-docs get
+        ]
+        [ modified-docs get modified-sources get append diff ] bi
+    ] with-scope ;
+
+: do-refresh ( modified-sources modified-docs unchanged -- )
+    unchanged-vocabs
+    [
+        [ [ vocab f >>source-loaded? drop ] each ]
+        [ [ vocab f >>docs-loaded? drop ] each ] bi*
+    ]
+    [
+        append prune
+        [ unchanged-vocabs ]
+        [ require-all load-failures. ] bi
+    ] 2bi ;
+
+: refresh ( prefix -- ) to-refresh do-refresh ;
+
+: refresh-all ( -- ) "" refresh ;
\ No newline at end of file
diff --git a/basis/vocabs/refresh/summary.txt b/basis/vocabs/refresh/summary.txt
new file mode 100644 (file)
index 0000000..4f75199
--- /dev/null
@@ -0,0 +1 @@
+Reloading changed vocabularies from disk
diff --git a/core/alien/dlls/authors.txt b/core/alien/dlls/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/core/alien/dlls/dlls.factor b/core/alien/dlls/dlls.factor
new file mode 100644 (file)
index 0000000..ca0082c
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: ;
+IN: alien.dlls
index 7915dc69e092be8ac951262bd0386e8447684716..01e0b18887d3ef7d5a2cf4b1cb0b87988bbd58c0 100644 (file)
@@ -198,9 +198,10 @@ SYMBOL: interactive-vocabs
     "tools.test"
     "tools.threads"
     "tools.time"
-    "tools.vocabs"
     "vocabs"
     "vocabs.loader"
+    "vocabs.refresh"
+    "vocabs.hierarchy"
     "words"
     "scratchpad"
 } interactive-vocabs set-global
index eb1284cd2503085d314f9d4773c973728ce34d2c..91c039dbae87c51cce1071feb2226317c83dde86 100644 (file)
@@ -3,7 +3,7 @@ definitions quotations compiler.units ;
 IN: source-files
 
 ARTICLE: "source-files" "Source files"
-"Words in the " { $vocab-link "source-files" } " vocabulary are used to keep track of loaded source files. This is used to implement " { $link "tools.vocabs" } "."
+"Words in the " { $vocab-link "source-files" } " vocabulary are used to keep track of loaded source files. This is used to implement " { $link "vocabs.refresh" } "."
 $nl
 "The source file database:"
 { $subsection source-files }
@@ -41,7 +41,7 @@ HELP: record-checksum
 $low-level-note ;
 
 HELP: reset-checksums
-{ $description "Resets recorded modification times and CRC32 checksums for all loaded source files, creating a checkpoint for " { $link "tools.vocabs" } "." } ;
+{ $description "Resets recorded modification times and CRC32 checksums for all loaded source files, creating a checkpoint for " { $link "vocabs.refresh" } "." } ;
 
 HELP: forget-source
 { $values { "path" "a pathname string" } }
index e0d6fd44931ed4ca3c410aba0895b2f4c0c95298..03d234807d6a6332aacd30b8c2044e7c4d3dcbac 100644 (file)
@@ -106,7 +106,7 @@ HELP: reload
 HELP: require
 { $values { "vocab" "a vocabulary specifier" } }
 { $description "Loads a vocabulary if it has not already been loaded." }
-{ $notes "To unconditionally reload a vocabulary, use " { $link reload } ". To reload changed source files only, use the words in " { $link "tools.vocabs" } "." } ;
+{ $notes "To unconditionally reload a vocabulary, use " { $link reload } ". To reload changed source files only, use the words in " { $link "vocabs.refresh" } "." } ;
 
 HELP: run
 { $values { "vocab" "a vocabulary specifier" } }
index f7c8a89e8c3b12bca00521a8bdcc9d28d98a542e..88a37cb450f111afd3c9d1165d7020b052d9e672 100644 (file)
@@ -1,9 +1,9 @@
-IN: vocabs.loader.tests
 USING: vocabs.loader tools.test continuations vocabs math
 kernel arrays sequences namespaces io.streams.string
 parser source-files words assocs classes.tuple definitions
-debugger compiler.units tools.vocabs accessors eval
+debugger compiler.units accessors eval
 combinators vocabs.parser grouping ;
+IN: vocabs.loader.tests
 
 ! This vocab should not exist, but just in case...
 [ ] [
index 220f16fad57e8cdcb5cee5e40c134e1c426f8875..6c64e34835fba1ea903e89ff265389695da0e3f9 100755 (executable)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2007, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel vocabs vocabs.loader tools.time tools.vocabs
+USING: kernel vocabs vocabs.loader tools.time vocabs.hierarchy
 arrays assocs io.styles io help.markup prettyprint sequences
 continuations debugger math namespaces memory ;
 IN: benchmark
diff --git a/extra/benchmark/gc0/authors.txt b/extra/benchmark/gc0/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/extra/benchmark/gc0/gc0.factor b/extra/benchmark/gc0/gc0.factor
new file mode 100644 (file)
index 0000000..997e8df
--- /dev/null
@@ -0,0 +1,9 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: arrays kernel math ;
+IN: benchmark.gc0
+
+: allocate ( -- obj ) 10 f <array> ;
+: gc0 ( -- ) f 60000000 [ allocate nip ] times drop ;
+
+MAIN: gc0
\ No newline at end of file
diff --git a/extra/benchmark/gc2/authors.txt b/extra/benchmark/gc2/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/extra/benchmark/gc2/gc2.factor b/extra/benchmark/gc2/gc2.factor
new file mode 100644 (file)
index 0000000..58f645a
--- /dev/null
@@ -0,0 +1,24 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: arrays byte-arrays kernel namespaces sequences math memory ;
+IN: benchmark.gc2
+
+! Runs slowly if clean cards are not unmarked.
+SYMBOL: oldies
+
+: make-old-objects ( -- )
+    1000000 [ 1 f <array> ] replicate oldies set gc
+    oldies get [ "HI" swap set-first ] each ;
+
+: allocate ( -- x ) 20000 (byte-array) ;
+
+: age ( -- )
+    1000 [ allocate drop ] times ;
+
+: gc2 ( -- )
+    [
+        make-old-objects
+        50000 [ age ] times
+    ] with-scope ;
+
+MAIN: gc2
\ No newline at end of file
index 30d6845a9b3413afcc4fb0732a4c94c22bbc5080..6c43e646df97046e0e53673fc535960e1921c1fa 100644 (file)
@@ -3,8 +3,8 @@
 
 USING: accessors arrays assocs combinators help help.crossref
 help.markup help.topics io io.streams.string kernel make namespaces
-parser prettyprint sequences summary tools.vocabs help.vocabs
-vocabs vocabs.loader words see ;
+parser prettyprint sequences summary help.vocabs
+vocabs vocabs.loader vocabs.hierarchy vocabs.metadata words see ;
 
 IN: fuel.help
 
@@ -21,9 +21,9 @@ IN: fuel.help
     [ see ] with-string-writer ; inline
 
 : fuel-methods-str ( word -- str )
-    methods dup empty? not [
+    methods [ f ] [
         [ [ see nl ] each ] with-string-writer
-    ] [ drop f ] if ; inline
+    ] if-empty ; inline
 
 : fuel-related-words ( word -- seq )
     dup "related" word-prop remove ; inline
index ec06b9892e0a008e2c492733618638f4622a1cff..160b7212c4c870b821dc08f58ed46ec3ebe325df 100644 (file)
@@ -3,7 +3,7 @@
 
 USING: accessors arrays assocs definitions help.topics io.pathnames
 kernel math math.order memoize namespaces sequences sets sorting
-tools.completion tools.crossref tools.vocabs vocabs vocabs.parser
+tools.completion tools.crossref vocabs vocabs.parser vocabs.hierarchy
 words ;
 
 IN: fuel.xref
index be713542eddaa7b8d7dfb4975a61331afe8cdad4..ba929867e99c56adeea3f03583bc5a19f09bc70f 100644 (file)
@@ -3,7 +3,7 @@
 USING: slides help.markup math arrays hashtables namespaces
 sequences kernel sequences parser memoize io.encodings.binary
 locals kernel.private help.vocabs assocs quotations
-urls peg.ebnf tools.vocabs tools.annotations tools.crossref
+urls peg.ebnf tools.annotations tools.crossref
 help.topics math.functions compiler.tree.optimizer
 compiler.cfg.optimizer fry ;
 IN: galois-talk
index ab8e72fc76bb58cdf1712dc121381caaee0a38ea..8e2eeeb1a7fd0bbb88ff156231fe154f74764539 100644 (file)
@@ -3,7 +3,7 @@
 USING: slides help.markup math arrays hashtables namespaces
 sequences kernel sequences parser memoize io.encodings.binary
 locals kernel.private help.vocabs assocs quotations
-urls peg.ebnf tools.vocabs tools.annotations tools.crossref
+urls peg.ebnf tools.annotations tools.crossref
 help.topics math.functions compiler.tree.optimizer
 compiler.cfg.optimizer fry ;
 IN: google-tech-talk
index b255b351f0cb613368a48d4d2f57ed87209c3a04..e4a9d9da13a96cfd80f8955893b84eb56d9210b7 100755 (executable)
@@ -90,8 +90,8 @@ SYMBOL: stamp
 : ?prepare-build-machine ( -- )
     builds/factor exists? [ prepare-build-machine ] unless ;
 
-CONSTANT: load-everything-vocabs-file "load-everything-vocabs"
-CONSTANT: load-everything-errors-file "load-everything-errors"
+CONSTANT: load-all-vocabs-file "load-everything-vocabs"
+CONSTANT: load-all-errors-file "load-everything-errors"
 
 CONSTANT: test-all-vocabs-file "test-all-vocabs"
 CONSTANT: test-all-errors-file "test-all-errors"
index 64d31b43688f3708ac78dd6c5c434ed69eb5e04e..7707d162991c3124e8ce744289fa3f575f52f9a0 100644 (file)
@@ -89,8 +89,8 @@ IN: mason.report
             timings-table
 
             "Load failures"
-            load-everything-vocabs-file
-            load-everything-errors-file
+            load-all-vocabs-file
+            load-all-errors-file
             error-dump
 
             "Compiler errors"
@@ -120,7 +120,7 @@ IN: mason.report
 
 : build-clean? ( -- ? )
     {
-        [ load-everything-vocabs-file eval-file empty? ]
+        [ load-all-vocabs-file eval-file empty? ]
         [ test-all-vocabs-file eval-file empty? ]
         [ help-lint-vocabs-file eval-file empty? ]
         [ compiler-errors-file eval-file empty? ]
index 22b932ac5b92c2fdcb17f0ca586d05bf71bcb165..d50c77f71b8cac7a125561858e6f2e71e670ba6e 100644 (file)
@@ -3,14 +3,15 @@
 USING: accessors assocs benchmark bootstrap.stage2 compiler.errors
 source-files.errors generic help.html help.lint io.directories
 io.encodings.utf8 io.files kernel mason.common math namespaces
-prettyprint sequences sets sorting tools.test tools.time tools.vocabs
-words system io tools.errors locals ;
+prettyprint sequences sets sorting tools.test tools.time
+words system io tools.errors vocabs.hierarchy vocabs.errors
+vocabs.refresh locals ;
 IN: mason.test
 
 : do-load ( -- )
-    try-everything
-    [ keys load-everything-vocabs-file to-file ]
-    [ load-everything-errors-file utf8 [ load-failures. ] with-file-writer ]
+    "" (load)
+    [ keys load-all-vocabs-file to-file ]
+    [ load-all-errors-file utf8 [ load-failures. ] with-file-writer ]
     bi ;
 
 GENERIC: word-vocabulary ( word -- vocabulary )
index b7256246fe378b66ea428d5f7808f6130e985956..35a83a63de6eb4dbfbf2ae8be9e82bfd31e13d6f 100644 (file)
@@ -1,12 +1,12 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: slides help.markup math arrays hashtables namespaces sequences
-kernel sequences parser memoize io.encodings.binary locals
-kernel.private help.vocabs assocs quotations tools.vocabs
+USING: slides help.markup math arrays hashtables namespaces
+sequences kernel sequences parser memoize io.encodings.binary
+locals kernel.private help.vocabs assocs quotations
 tools.annotations tools.crossref help.topics math.functions
-compiler.tree.optimizer compiler.cfg.optimizer fry ui.gadgets.panes
-tetris tetris.game combinators generalizations multiline
-sequences.private ;
+compiler.tree.optimizer compiler.cfg.optimizer fry
+ui.gadgets.panes tetris tetris.game combinators generalizations
+multiline sequences.private ;
 IN: otug-talk
 
 : $tetris ( element -- )
index 1e5c9602b98b500757213f519dafff050910b108..4ee499bf50c08fa7cffbc92784cfe2760b0b551d 100644 (file)
@@ -2,10 +2,10 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: slides help.markup math arrays hashtables namespaces
 sequences kernel sequences parser memoize io.encodings.binary
-locals kernel.private help.vocabs assocs quotations
-urls peg.ebnf tools.vocabs tools.annotations tools.crossref
-help.topics math.functions compiler.tree.optimizer
-compiler.cfg.optimizer fry ;
+locals kernel.private help.vocabs assocs quotations urls
+peg.ebnf tools.annotations tools.crossref help.topics
+math.functions compiler.tree.optimizer compiler.cfg.optimizer
+fry ;
 IN: vpri-talk
 
 CONSTANT: vpri-slides