From a4c5a748adb2462eb6a9a4017d852a4825a43ea8 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 8 Jun 2015 12:02:25 -0700 Subject: [PATCH] core/basis: Rename words dealing with vocabs to loaded-vocabs or disk-vocabs because it's too confusing otherwise. --- basis/bootstrap/compiler/compiler.factor | 2 +- basis/bootstrap/stage2.factor | 2 +- basis/editors/editors.factor | 2 +- basis/help/html/html.factor | 2 +- basis/help/lint/checks/checks.factor | 6 +- basis/help/lint/lint.factor | 10 ++- basis/help/vocabs/vocabs.factor | 9 ++- basis/html/templates/chloe/chloe.factor | 18 ++---- basis/opengl/annotations/annotations.factor | 2 +- basis/present/present-tests.factor | 2 +- basis/tools/completion/completion.factor | 2 +- basis/tools/coverage/coverage.factor | 14 ++--- basis/tools/crossref/crossref.factor | 2 +- basis/tools/deploy/shaker/shaker.factor | 6 +- basis/tools/scaffold/scaffold.factor | 4 +- basis/tools/test/test.factor | 4 +- .../pixel-formats/pixel-formats-docs.factor | 2 +- basis/vocabs/cache/cache.factor | 2 +- basis/vocabs/hierarchy/hierarchy-docs.factor | 8 +-- basis/vocabs/hierarchy/hierarchy.factor | 61 +++++++++---------- basis/vocabs/refresh/monitor/monitor.factor | 2 +- basis/vocabs/refresh/refresh.factor | 2 +- core/bootstrap/primitives.factor | 8 +-- core/vocabs/loader/loader-tests.factor | 2 +- core/vocabs/vocabs-docs.factor | 22 +++---- core/vocabs/vocabs.factor | 26 ++++---- core/words/words-tests.factor | 6 +- core/words/words.factor | 6 +- extra/benchmark/benchmark.factor | 2 +- extra/benchmark/dispatch1/dispatch1.factor | 2 +- extra/benchmark/dispatch5/dispatch5.factor | 2 +- extra/fuel/fuel.factor | 2 +- extra/fuel/help/help.factor | 14 ++--- extra/fuel/xref/xref.factor | 6 +- extra/lint/lint.factor | 17 +++--- .../tuple/persistent/persistent.factor | 9 ++- .../readline-listener.factor | 2 +- extra/reports/noise/noise.factor | 2 +- extra/slots/syntax/syntax.factor | 4 +- extra/smalltalk/compiler/compiler.factor | 13 ++-- 40 files changed, 146 insertions(+), 163 deletions(-) diff --git a/basis/bootstrap/compiler/compiler.factor b/basis/bootstrap/compiler/compiler.factor index d22f0d95c5..6ce7a3d44e 100644 --- a/basis/bootstrap/compiler/compiler.factor +++ b/basis/bootstrap/compiler/compiler.factor @@ -124,7 +124,7 @@ gc "." write flush - vocabs [ words compile-unoptimized "." write flush ] each + loaded-vocab-names [ vocab-words compile-unoptimized "." write flush ] each " done" print flush diff --git a/basis/bootstrap/stage2.factor b/basis/bootstrap/stage2.factor index 15872ce499..e7a79808ba 100644 --- a/basis/bootstrap/stage2.factor +++ b/basis/bootstrap/stage2.factor @@ -16,7 +16,7 @@ SYMBOL: bootstrap-time P" resource:core/io/encodings/utf16/utf16.factor" P" resource:core/io/encodings/utf16n/utf16n.factor" [ forget ] bi@ "io.encodings.utf16" - "io.encodings.utf16n" [ child-vocabs [ forget-vocab ] each ] bi@ + "io.encodings.utf16n" [ loaded-child-vocab-names [ forget-vocab ] each ] bi@ ] with-compilation-unit ] when ; diff --git a/basis/editors/editors.factor b/basis/editors/editors.factor index 665dd74933..4239fb0e46 100644 --- a/basis/editors/editors.factor +++ b/basis/editors/editors.factor @@ -12,7 +12,7 @@ IN: editors SYMBOL: editor-class : available-editors ( -- seq ) - "editors" child-vocab-names ; + "editors" loaded-child-vocab-names ; : editor-restarts ( -- alist ) available-editors diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index 5b9a646ee5..73fe06d16f 100644 --- a/basis/help/html/html.factor +++ b/basis/help/html/html.factor @@ -98,7 +98,7 @@ M: pathname url-of dup topic>filename utf8 [ help>html write-xml ] with-file-writer ; : all-vocabs-really ( -- seq ) - all-vocabs-recursive no-roots remove-redundant-prefixes + all-disk-vocabs-recursive no-roots remove-redundant-prefixes [ vocab-name "scratchpad" = ] reject ; : all-topics ( -- topics ) diff --git a/basis/help/lint/checks/checks.factor b/basis/help/lint/checks/checks.factor index d5f5cce259..ad25daf2b2 100644 --- a/basis/help/lint/checks/checks.factor +++ b/basis/help/lint/checks/checks.factor @@ -17,7 +17,7 @@ M: simple-lint-error summary message>> ; M: simple-lint-error error. summary print ; SYMBOL: vocabs-quot -SYMBOL: all-vocabs +SYMBOL: all-vocabs-list SYMBOL: vocab-articles : check-example ( element -- ) @@ -110,7 +110,7 @@ SYMBOL: vocab-articles [ "$see-also are not unique" simple-lint-error ] unless ; : vocab-exists? ( name -- ? ) - [ lookup-vocab ] [ all-vocabs get member? ] bi or ; + [ lookup-vocab ] [ all-vocabs-list get member? ] bi or ; : check-modules ( element -- ) \ $vocab-link swap elements [ @@ -199,7 +199,7 @@ SYMBOL: vocab-articles } cleave ; : files>vocabs ( -- assoc ) - vocabs + loaded-vocab-names [ [ [ vocab-docs-path ] keep ] H{ } map>assoc ] [ [ [ vocab-source-path ] keep ] H{ } map>assoc ] bi assoc-union ; diff --git a/basis/help/lint/lint.factor b/basis/help/lint/lint.factor index 25115905b4..5f506c9cfb 100644 --- a/basis/help/lint/lint.factor +++ b/basis/help/lint/lint.factor @@ -4,8 +4,6 @@ USING: assocs combinators continuations fry help help.lint.checks help.topics io kernel namespaces parser sequences source-files.errors vocabs.hierarchy vocabs words classes locals tools.errors listener ; -FROM: help.lint.checks => all-vocabs ; -FROM: vocabs => child-vocabs ; IN: help.lint SYMBOL: lint-failures @@ -73,7 +71,7 @@ PRIVATE> : check-vocab ( vocab -- ) "Checking " write dup write "..." print flush [ check-about ] - [ words [ check-word ] each ] + [ vocab-words [ check-word ] each ] [ vocab-articles get at [ check-article ] each ] tri ; @@ -82,9 +80,9 @@ PRIVATE> : help-lint ( prefix -- ) [ auto-use? off - all-vocab-names all-vocabs set + all-disk-vocab-names all-vocabs-list set group-articles vocab-articles set - child-vocabs + loaded-child-vocab-names [ check-vocab ] each ] with-scope ; @@ -93,7 +91,7 @@ PRIVATE> : :lint-failures ( -- ) lint-failures get values errors. ; : unlinked-words ( vocab -- seq ) - words all-word-help [ article-parent ] reject ; + vocab-words all-word-help [ article-parent ] reject ; : linked-undocumented-words ( -- seq ) all-words diff --git a/basis/help/vocabs/vocabs.factor b/basis/help/vocabs/vocabs.factor index 3f7c2d0184..a2e7e86ae1 100644 --- a/basis/help/vocabs/vocabs.factor +++ b/basis/help/vocabs/vocabs.factor @@ -8,7 +8,6 @@ help.topics io io.pathnames io.styles kernel macros make namespaces sequences sorting summary vocabs vocabs.files vocabs.hierarchy vocabs.loader vocabs.metadata words words.symbol ; -FROM: vocabs.hierarchy => child-vocabs ; IN: help.vocabs : about ( vocab -- ) @@ -60,7 +59,7 @@ C: vocab-author ] unless-empty ; : describe-children ( vocab -- ) - vocab-name child-vocabs + vocab-name disk-vocabs-for-prefix $vocab-roots ; : files. ( seq -- ) @@ -226,14 +225,14 @@ C: vocab-author : describe-words ( vocab -- ) { - { [ dup lookup-vocab ] [ words $words ] } + { [ dup lookup-vocab ] [ vocab-words $words ] } { [ dup find-vocab-root ] [ vocab-is-not-loaded ] } [ drop ] } cond ; : words. ( vocab -- ) last-element off - [ require ] [ words $words ] bi nl ; + [ require ] [ vocab-words $words ] bi nl ; : describe-metadata ( vocab -- ) [ @@ -254,7 +253,7 @@ C: vocab-author } cleave ; : keyed-vocabs ( str quot -- seq ) - [ all-vocabs-recursive ] 2dip '[ + [ all-disk-vocabs-recursive ] 2dip '[ [ _ swap @ member? ] filter no-prefixes [ name>> ] sort-with ] assoc-map ; inline diff --git a/basis/html/templates/chloe/chloe.factor b/basis/html/templates/chloe/chloe.factor index 092997a110..0cd639d805 100644 --- a/basis/html/templates/chloe/chloe.factor +++ b/basis/html/templates/chloe/chloe.factor @@ -1,18 +1,10 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors kernel sequences combinators fry -namespaces make classes.tuple assocs splitting words arrays io -io.files io.files.info io.encodings.utf8 io.streams.string -unicode.case mirrors math urls present multiline quotations xml -logging -xml.writer xml.syntax strings -html.forms -html -html.components -html.templates -html.templates.chloe.compiler -html.templates.chloe.components -html.templates.chloe.syntax ; +USING: accessors assocs html.components html.forms +html.templates html.templates.chloe.compiler +html.templates.chloe.components html.templates.chloe.syntax +io.encodings.utf8 io.files io.files.info kernel logging make +math namespaces sequences splitting words xml xml.syntax ; IN: html.templates.chloe TUPLE: chloe path ; diff --git a/basis/opengl/annotations/annotations.factor b/basis/opengl/annotations/annotations.factor index 54334c8aef..ef4e13c784 100644 --- a/basis/opengl/annotations/annotations.factor +++ b/basis/opengl/annotations/annotations.factor @@ -25,7 +25,7 @@ gl-error-log [ V{ } clone ] initialize name>> { [ "glGetError" = not ] [ "gl" head? ] [ third LETTER? ] } 1&& ; : gl-functions ( -- words ) - "opengl.gl" lookup-vocab words [ gl-function? ] filter ; + "opengl.gl" lookup-vocab vocab-words [ gl-function? ] filter ; : annotate-gl-functions ( quot -- ) [ diff --git a/basis/present/present-tests.factor b/basis/present/present-tests.factor index 4a68e7ac1f..8fc494918b 100644 --- a/basis/present/present-tests.factor +++ b/basis/present/present-tests.factor @@ -6,7 +6,7 @@ vocabs.hierarchy ; { "Hi" } [ "Hi" present ] unit-test { "+" } [ \ + present ] unit-test { "kernel" } [ "kernel" lookup-vocab present ] unit-test -{ } [ all-vocabs-recursive filter-vocabs [ present ] map drop ] unit-test +{ } [ disk-vocabs-recursive filter-vocabs [ present ] map drop ] unit-test { "1+1j" } [ C{ 1 1 } present ] unit-test { "1-1j" } [ C{ 1 -1 } present ] unit-test diff --git a/basis/tools/completion/completion.factor b/basis/tools/completion/completion.factor index f22b70048e..b3632c9f29 100644 --- a/basis/tools/completion/completion.factor +++ b/basis/tools/completion/completion.factor @@ -99,7 +99,7 @@ PRIVATE> all-words name-completions ; : vocabs-matching ( str -- seq ) - all-vocabs-recursive filter-vocabs name-completions ; + all-disk-vocabs-recursive filter-vocabs name-completions ; : chars-matching ( str -- seq ) name-map keys dup zip completions ; diff --git a/basis/tools/coverage/coverage.factor b/basis/tools/coverage/coverage.factor index d21f516355..ff37fa441d 100644 --- a/basis/tools/coverage/coverage.factor +++ b/basis/tools/coverage/coverage.factor @@ -1,10 +1,10 @@ ! Copyright (C) 2011 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays assocs classes combinators -combinators.short-circuit continuations fry io kernel math -namespaces prettyprint quotations sequences sequences.deep -splitting strings tools.annotations tools.test -tools.test.private vocabs words words.symbol ; +USING: accessors arrays assocs classes combinators.short-circuit +continuations fry io kernel math namespaces prettyprint +quotations sequences sequences.deep splitting strings +tools.annotations tools.test.private vocabs vocabs.hierarchy +words words.symbol ; IN: tools.coverage TUPLE: coverage-state < identity-tuple executed? ; @@ -32,7 +32,7 @@ GENERIC: reset-coverage ( object -- ) ".private" ?tail drop ".private" append ; : coverage-words ( string -- words ) - words [ { [ primitive? not ] [ symbol? not ] [ predicate? not ] } 1&& ] filter ; + vocab-words [ { [ primitive? not ] [ symbol? not ] [ predicate? not ] } 1&& ] filter ; PRIVATE> @@ -131,7 +131,7 @@ PRIVATE> { [ ".private" tail? ] [ ".tests" tail? ] } 1|| not ; : test-coverage-recursively ( prefix -- assoc ) - child-vocabs [ coverage-vocab? ] filter + disk-vocabs-for-prefix [ coverage-vocab? ] filter [ dup test-coverage ] { } map>assoc ; : %coverage ( string -- x ) diff --git a/basis/tools/crossref/crossref.factor b/basis/tools/crossref/crossref.factor index 04aae88ae8..12cca05af9 100644 --- a/basis/tools/crossref/crossref.factor +++ b/basis/tools/crossref/crossref.factor @@ -115,7 +115,7 @@ M: f smart-usage drop \ f smart-usage ; [ "No usages." print ] [ sorted-definitions. ] if-empty ; : vocab-xref ( vocab quot: ( defspec -- seq ) -- vocabs ) - [ [ vocab-name ] [ words [ generic? ] reject ] bi ] dip map + [ [ vocab-name ] [ vocab-words [ generic? ] reject ] bi ] dip map [ [ [ word? ] [ generic? not ] bi and ] filter [ dup method? diff --git a/basis/tools/deploy/shaker/shaker.factor b/basis/tools/deploy/shaker/shaker.factor index f4a56b8cf6..e5831b54fe 100755 --- a/basis/tools/deploy/shaker/shaker.factor +++ b/basis/tools/deploy/shaker/shaker.factor @@ -245,7 +245,7 @@ IN: tools.deploy.shaker : compiler-classes ( -- seq ) { "compiler" "stack-checker" } - [ child-vocabs [ words ] map concat [ class? ] filter ] + [ loaded-child-vocab-names [ vocab-words ] map concat [ class? ] filter ] map concat unique ; : prune-decision-tree ( tree classes -- ) @@ -304,7 +304,7 @@ IN: tools.deploy.shaker ] when ; : vocab-tree-globals ( except names -- words ) - [ child-vocabs [ words ] map concat ] map concat + [ loaded-child-vocab-names [ vocab-words ] map concat ] map concat swap [ first2 lookup-word ] map sift diff ; : stripped-globals ( -- seq ) @@ -552,7 +552,7 @@ SYMBOL: deploy-vocab : write-vocab-manifest ( vocab-manifest-out -- ) "Writing vocabulary manifest to " write dup print flush - vocabs "VOCABS:" prefix + loaded-vocab-names "VOCABS:" prefix deploy-libraries get [ lookup-library path>> ] map members "LIBRARIES:" prefix append swap utf8 set-file-lines ; diff --git a/basis/tools/scaffold/scaffold.factor b/basis/tools/scaffold/scaffold.factor index 7cf5b14717..8a2841434b 100644 --- a/basis/tools/scaffold/scaffold.factor +++ b/basis/tools/scaffold/scaffold.factor @@ -28,7 +28,7 @@ ERROR: vocab-name-contains-dot path ; : contains-separator? ( string -- ? ) [ path-separator? ] any? ; : ensure-vocab-exists ( string -- string ) - dup vocabs member? [ no-vocab ] unless ; + dup loaded-vocab-names member? [ no-vocab ] unless ; : check-vocab-name ( string -- string ) [ ] @@ -215,7 +215,7 @@ M: object add-using ( object -- ) [ docs-header. ] [ docs-body. ] bi ; : interesting-words ( vocab -- array ) - words + vocab-words [ { [ "help" word-prop ] [ predicate? ] } 1|| ] reject natural-sort ; diff --git a/basis/tools/test/test.factor b/basis/tools/test/test.factor index b559bf3977..11ce24bfd2 100644 --- a/basis/tools/test/test.factor +++ b/basis/tools/test/test.factor @@ -166,9 +166,9 @@ M: test-failure error. ( error -- ) : :test-failures ( -- ) test-failures get errors. ; -: test ( prefix -- ) child-vocabs test-vocabs ; +: test ( prefix -- ) loaded-child-vocab-names test-vocabs ; -: test-all ( -- ) vocabs filter-don't-test test-vocabs ; +: test-all ( -- ) loaded-vocab-names filter-don't-test test-vocabs ; : test-main ( -- ) command-line get [ [ load ] [ test ] bi ] each ; diff --git a/basis/ui/pixel-formats/pixel-formats-docs.factor b/basis/ui/pixel-formats/pixel-formats-docs.factor index 9309085676..75921eec44 100644 --- a/basis/ui/pixel-formats/pixel-formats-docs.factor +++ b/basis/ui/pixel-formats/pixel-formats-docs.factor @@ -6,7 +6,7 @@ IN: ui.pixel-formats << "ui.gadgets.worlds" create-vocab drop "world" "ui.gadgets.worlds" create drop - "ui.gadgets.worlds" vocab-words use-words + "ui.gadgets.worlds" vocab-words-assoc use-words >> ARTICLE: "ui.pixel-formats-attributes" "Pixel format attributes" diff --git a/basis/vocabs/cache/cache.factor b/basis/vocabs/cache/cache.factor index 4a2fa11723..9947b3b833 100644 --- a/basis/vocabs/cache/cache.factor +++ b/basis/vocabs/cache/cache.factor @@ -12,7 +12,7 @@ IN: vocabs.cache \ vocab-file-contents "memoize" word-prop swap '[ drop first vocab-name _ = ] assoc-reject! drop ] bi - \ all-vocabs-recursive reset-memoized + \ all-disk-vocabs-recursive reset-memoized \ all-authors reset-memoized \ all-tags reset-memoized ; diff --git a/basis/vocabs/hierarchy/hierarchy-docs.factor b/basis/vocabs/hierarchy/hierarchy-docs.factor index 94072ed2dd..c6a15749cf 100644 --- a/basis/vocabs/hierarchy/hierarchy-docs.factor +++ b/basis/vocabs/hierarchy/hierarchy-docs.factor @@ -14,13 +14,13 @@ $nl } "Getting all vocabularies from disk:" { $subsections - all-vocabs - all-vocabs-recursive + all-disk-vocabs-by-root + all-disk-vocabs-recursive } "Getting all vocabularies from disk whose names which match a string prefix:" { $subsections - child-vocabs - child-vocabs-recursive + disk-vocabs-for-prefix + disk-vocabs-recursive-for-prefix } "Words for modifying output:" { $subsections diff --git a/basis/vocabs/hierarchy/hierarchy.factor b/basis/vocabs/hierarchy/hierarchy.factor index 07c2097e35..704f7ef63b 100644 --- a/basis/vocabs/hierarchy/hierarchy.factor +++ b/basis/vocabs/hierarchy/hierarchy.factor @@ -4,7 +4,6 @@ USING: accessors arrays assocs combinators.short-circuit fry io.directories io.files io.files.types io.pathnames kernel make memoize namespaces sequences sorting splitting vocabs sets vocabs.loader vocabs.metadata vocabs.errors ; -RENAME: child-vocabs vocabs => vocabs:child-vocabs IN: vocabs.hierarchy TUPLE: vocab-prefix name ; @@ -40,33 +39,33 @@ ERROR: vocab-root-required root ; : ensure-vocab-root/prefix ( root prefix -- root prefix ) [ ensure-vocab-root ] [ check-vocab-name ] bi* ; -: (child-vocabs) ( root prefix -- vocabs ) +: (disk-vocab-children) ( root prefix -- vocabs ) check-vocab-name [ vocab-dir append-path dup exists? [ vocab-subdirs ] [ drop { } ] if ] [ nip [ "." append '[ _ prepend ] map! ] unless-empty ] [ drop '[ _ over vocab-dir? [ >vocab-link ] [ ] if ] map! ] 2tri ; -: ((child-vocabs-recursive)) ( root prefix -- ) - dupd vocab-name (child-vocabs) [ % ] keep - [ ((child-vocabs-recursive)) ] with each ; +: ((disk-vocabs-recursive)) ( root prefix -- ) + dupd vocab-name (disk-vocab-children) [ % ] keep + [ ((disk-vocabs-recursive)) ] with each ; -: (child-vocabs-recursive) ( root prefix -- seq ) +: (disk-vocabs-recursive) ( root prefix -- seq ) [ ensure-vocab-root ] dip - [ ((child-vocabs-recursive)) ] { } make ; + [ ((disk-vocabs-recursive)) ] { } make ; : no-rooted ( seq -- seq' ) [ find-vocab-root ] reject ; : one-level-only? ( name prefix -- ? ) ?head [ "." split1 nip not ] [ drop f ] if ; -: unrooted-child-vocabs ( prefix -- seq ) - [ vocabs no-rooted ] dip +: unrooted-disk-vocabs ( prefix -- seq ) + [ loaded-vocab-names no-rooted ] dip dup empty? [ CHAR: . suffix ] unless '[ vocab-name _ one-level-only? ] filter ; -: unrooted-child-vocabs-recursive ( prefix -- seq ) - vocabs:child-vocabs no-rooted ; +: unrooted-disk-vocabs-recursive ( prefix -- seq ) + loaded-child-vocab-names no-rooted ; PRIVATE> @@ -90,32 +89,32 @@ PRIVATE> : filter-vocabs ( assoc -- seq ) no-roots no-prefixes members ; -: child-vocabs ( prefix -- assoc ) - [ [ vocab-roots get ] dip '[ dup _ (child-vocabs) ] { } map>assoc ] - [ unrooted-child-vocabs [ lookup-vocab ] map! f swap 2array ] +: disk-vocabs-for-prefix ( prefix -- assoc ) + [ [ vocab-roots get ] dip '[ dup _ (disk-vocab-children) ] { } map>assoc ] + [ unrooted-disk-vocabs [ lookup-vocab ] map! f swap 2array ] bi suffix ; -: all-vocabs ( -- assoc ) - "" child-vocabs ; +: all-disk-vocabs-by-root ( -- assoc ) + "" disk-vocabs-for-prefix ; -: child-vocabs-recursive ( prefix -- assoc ) - [ [ vocab-roots get ] dip '[ dup _ (child-vocabs-recursive) ] { } map>assoc ] - [ unrooted-child-vocabs-recursive [ lookup-vocab ] map! f swap 2array ] +: disk-vocabs-recursive-for-prefix ( prefix -- assoc ) + [ [ vocab-roots get ] dip '[ dup _ (disk-vocabs-recursive) ] { } map>assoc ] + [ unrooted-disk-vocabs-recursive [ lookup-vocab ] map! f swap 2array ] bi suffix ; -MEMO: all-vocabs-recursive ( -- assoc ) - "" child-vocabs-recursive ; +MEMO: all-disk-vocabs-recursive ( -- assoc ) + "" disk-vocabs-recursive-for-prefix ; -: all-vocab-names ( -- seq ) - all-vocabs-recursive filter-vocabs [ vocab-name ] map! ; +: all-disk-vocab-names ( -- seq ) + all-disk-vocabs-recursive filter-vocabs [ vocab-name ] map! ; -: child-vocab-names ( prefix -- seq ) - child-vocabs filter-vocabs [ vocab-name ] map! ; +: disk-child-vocab-names ( prefix -- seq ) + disk-vocabs-for-prefix filter-vocabs [ vocab-name ] map! ; -: vocabs-in-root/prefix ( root prefix -- seq ) - [ (child-vocabs-recursive) ] +: disk-vocabs-in-root/prefix ( root prefix -- seq ) + [ (disk-vocabs-recursive) ] [ maybe-include-root/prefix [ prefix ] when* ] 2bi ; -: vocabs-in-root ( root -- seq ) - "" vocabs-in-root/prefix ; +: disk-vocabs-in-root ( root -- seq ) + "" disk-vocabs-in-root/prefix ; : (load-from-root) ( root prefix -- failures ) - vocabs-in-root/prefix + disk-vocabs-in-root/prefix [ don't-load? ] reject no-prefixes require-all ; diff --git a/basis/vocabs/refresh/monitor/monitor.factor b/basis/vocabs/refresh/monitor/monitor.factor index ccb87c88dc..2320fc4a04 100644 --- a/basis/vocabs/refresh/monitor/monitor.factor +++ b/basis/vocabs/refresh/monitor/monitor.factor @@ -49,7 +49,7 @@ TR: convert-separators "/\\" ".." ; : init-vocab-monitor ( -- ) H{ } clone changed-vocabs set-global - vocabs [ changed-vocab ] each ; + loaded-vocab-names [ changed-vocab ] each ; [ "-no-monitors" (command-line) member? [ diff --git a/basis/vocabs/refresh/refresh.factor b/basis/vocabs/refresh/refresh.factor index e9ecc92cc0..3106bdc82b 100644 --- a/basis/vocabs/refresh/refresh.factor +++ b/basis/vocabs/refresh/refresh.factor @@ -55,7 +55,7 @@ SYMBOL: changed-vocabs [ vocab-docs-path ] tri (to-refresh) ; : to-refresh ( prefix -- modified-sources modified-docs unchanged ) - child-vocabs [ ".private" tail? ] reject + loaded-child-vocab-names [ ".private" tail? ] reject [ [ [ vocab-source-modified? ] filter ] [ [ vocab-docs-modified? ] filter ] bi diff --git a/core/bootstrap/primitives.factor b/core/bootstrap/primitives.factor index 1ef404a9b7..e6cc5209df 100755 --- a/core/bootstrap/primitives.factor +++ b/core/bootstrap/primitives.factor @@ -27,7 +27,7 @@ architecture get asm-file parse-file ! Now we have ( syntax-quot arch-quot layouts-quot ) on the stack ! Bring up a bare cross-compiling vocabulary. -"syntax" lookup-vocab vocab-words bootstrap-syntax set +"syntax" lookup-vocab vocab-words-assoc bootstrap-syntax set H{ } clone dictionary set H{ } clone root-cache set @@ -149,7 +149,7 @@ call( -- ) ! syntax-quot "f" "syntax" lookup-word { } define-builtin "f" "syntax" create [ not ] "predicate" set-word-prop -"f?" "syntax" vocab-words delete-at +"f?" "syntax" vocab-words-assoc delete-at "t" "syntax" lookup-word define-singleton-class @@ -180,7 +180,7 @@ define-predicate-class [ [ drop t ] "predicate" set-word-prop ] bi -"object?" "kernel" vocab-words delete-at +"object?" "kernel" vocab-words-assoc delete-at ! Empty class with no instances "null" "kernel" create @@ -188,7 +188,7 @@ bi [ [ drop f ] "predicate" set-word-prop ] bi -"null?" "kernel" vocab-words delete-at +"null?" "kernel" vocab-words-assoc delete-at "fixnum" "math" create { } define-builtin "fixnum" "math" create "integer>fixnum-strict" "math" create 1quotation "coercer" set-word-prop diff --git a/core/vocabs/loader/loader-tests.factor b/core/vocabs/loader/loader-tests.factor index f994da982d..76e4e8b2b3 100644 --- a/core/vocabs/loader/loader-tests.factor +++ b/core/vocabs/loader/loader-tests.factor @@ -187,7 +187,7 @@ forget-junk [ f ] [ "vocabs.loader.test.p" lookup-vocab ] unit-test [ ] [ "vocabs.loader.test.p.private" require ] unit-test -[ { "foo" } ] [ "vocabs.loader.test.p" words [ name>> ] map ] unit-test +[ { "foo" } ] [ "vocabs.loader.test.p" vocab-words [ name>> ] map ] unit-test [ "mnop" [ "vocabs.loader.test." swap suffix forget-vocab ] each diff --git a/core/vocabs/vocabs-docs.factor b/core/vocabs/vocabs-docs.factor index fa3caecff8..55894351aa 100644 --- a/core/vocabs/vocabs-docs.factor +++ b/core/vocabs/vocabs-docs.factor @@ -1,5 +1,5 @@ USING: help.markup help.syntax strings words compiler.units -vocabs.loader ; +vocabs.loader assocs ; IN: vocabs ARTICLE: "vocabularies" "Vocabularies" @@ -28,13 +28,13 @@ $nl "Looking up existing vocabularies and creating new vocabularies:" { $subsections lookup-vocab - child-vocabs + loaded-child-vocab-names create-vocab } "Getting words from a vocabulary:" { $subsections + vocab-words-assoc vocab-words - words all-words words-named } @@ -47,7 +47,7 @@ ABOUT: "vocabularies" HELP: dictionary { $var-description "Holds a hashtable mapping vocabulary names to vocabularies." } ; -HELP: vocabs +HELP: loaded-vocab-names { $values { "seq" "a sequence of strings" } } { $description "Outputs a sequence of all defined vocabulary names." } ; @@ -62,12 +62,12 @@ HELP: vocab-name { $values { "vocab-spec" "a vocabulary specifier" } { "name" string } } { $description "Outputs the name of a vocabulary." } ; -HELP: vocab-words -{ $values { "vocab-spec" "a vocabulary specifier" } { "words" "an assoc mapping strings to words" } } +HELP: vocab-words-assoc +{ $values { "vocab-spec" "a vocabulary specifier" } { "assoc/f" { $maybe assoc } } } { $description "Outputs the words defined in a vocabulary." } ; -HELP: words -{ $values { "vocab" string } { "seq" "a sequence of words" } } +HELP: vocab-words +{ $values { "vocab-spec" vocab-spec } { "seq" "a sequence of words" } } { $description "Outputs a sequence of words defined in the vocabulary, or " { $link f } " if no vocabulary with this name exists." } ; HELP: all-words @@ -95,12 +95,12 @@ HELP: create-vocab { $values { "name" string } { "vocab" vocab } } { $description "Creates a new vocabulary if one does not exist with the given name, otherwise outputs an existing vocabulary." } ; -HELP: child-vocabs -{ $values { "vocab" "a vocabulary specifier" } { "seq" "a sequence of strings" } } +HELP: loaded-child-vocab-names +{ $values { "vocab-spec" "a vocabulary specifier" } { "seq" "a sequence of strings" } } { $description "Outputs all vocabularies which are conceptually under " { $snippet "vocab" } " in the hierarchy." } { $examples { $unchecked-example - "\"io.streams\" child-vocabs ." + "\"io.streams\" loaded-child-vocab-names ." "{ \"io.streams.c\" \"io.streams.duplex\" \"io.streams.lines\" \"io.streams.nested\" \"io.streams.plain\" \"io.streams.string\" }" } } ; diff --git a/core/vocabs/vocabs.factor b/core/vocabs/vocabs.factor index 157213b44d..a8dd27f2e9 100644 --- a/core/vocabs/vocabs.factor +++ b/core/vocabs/vocabs.factor @@ -44,7 +44,7 @@ M: object vocab-name check-vocab-name ; : vocab-name* ( vocab-spec -- name ) vocab-name ".private" ?tail drop ; -: private-vocab? ( vocab -- ? ) +: private-vocab? ( vocab-spec -- ? ) vocab-name ".private" tail? ; GENERIC: lookup-vocab ( vocab-spec -- vocab ) @@ -53,13 +53,13 @@ M: vocab lookup-vocab ; M: object lookup-vocab ( name -- vocab ) vocab-name dictionary get at ; -GENERIC: vocab-words ( vocab-spec -- words ) +GENERIC: vocab-words-assoc ( vocab-spec -- assoc/f ) -M: vocab vocab-words words>> ; +M: vocab vocab-words-assoc words>> ; -M: object vocab-words lookup-vocab vocab-words ; +M: object vocab-words-assoc lookup-vocab vocab-words-assoc ; -M: f vocab-words ; +M: f vocab-words-assoc ; GENERIC: vocab-help ( vocab-spec -- help ) @@ -96,18 +96,18 @@ GENERIC: vocab-changed ( vocab obj -- ) ERROR: no-vocab name ; -: vocabs ( -- seq ) +: loaded-vocab-names ( -- seq ) dictionary get keys natural-sort ; -: words ( vocab -- seq ) - vocab-words values ; +: vocab-words ( vocab-spec -- seq ) + vocab-words-assoc values ; : all-words ( -- seq ) - dictionary get values [ words ] map concat ; + dictionary get values [ vocab-words ] map concat ; : words-named ( str -- seq ) dictionary get values - [ vocab-words at ] with map + [ vocab-words-assoc at ] with map sift ; : child-vocab? ( prefix name -- ? ) @@ -119,8 +119,8 @@ ERROR: no-vocab name ; ] if ] if-empty ; -: child-vocabs ( vocab -- seq ) - vocab-name vocabs [ child-vocab? ] with filter ; +: loaded-child-vocab-names ( vocab-spec -- seq ) + vocab-name loaded-vocab-names [ child-vocab? ] with filter ; GENERIC: >vocab-link ( name -- vocab ) @@ -129,7 +129,7 @@ M: vocab-spec >vocab-link ; M: object >vocab-link dup lookup-vocab [ ] [ ] ?if ; : forget-vocab ( vocab -- ) - [ words forget-all ] + [ vocab-words forget-all ] [ vocab-name dictionary get delete-at ] [ notify-vocab-observers ] tri ; diff --git a/core/words/words-tests.factor b/core/words/words-tests.factor index 605f8b8c4d..18914bcacb 100644 --- a/core/words/words-tests.factor +++ b/core/words/words-tests.factor @@ -11,7 +11,7 @@ IN: words.tests "poo" "words.tests" lookup-word execute ] unit-test -[ t ] [ t vocabs [ words [ word? and ] each ] each ] unit-test +[ t ] [ t loaded-vocab-names [ vocab-words [ word? and ] each ] each ] unit-test DEFER: plist-test @@ -41,8 +41,8 @@ DEFER: plist-test "test-scope" "scratchpad" lookup-word name>> ] unit-test -[ t ] [ vocabs array? ] unit-test -[ t ] [ vocabs [ words [ word? ] all? ] all? ] unit-test +[ t ] [ loaded-vocab-names array? ] unit-test +[ t ] [ loaded-vocab-names [ vocab-words [ word? ] all? ] all? ] unit-test [ f ] [ gensym gensym = ] unit-test diff --git a/core/words/words.factor b/core/words/words.factor index 8be802cde1..7b0f922e98 100644 --- a/core/words/words.factor +++ b/core/words/words.factor @@ -67,7 +67,7 @@ PREDICATE: primitive < word "primitive" word-prop ; M: primitive definer drop \ PRIMITIVE: f ; M: primitive definition drop f ; -: lookup-word ( name vocab -- word ) vocab-words at ; +: lookup-word ( name vocab -- word ) vocab-words-assoc at ; : target-word ( word -- target ) [ name>> ] [ vocabulary>> ] bi lookup-word ; @@ -200,7 +200,7 @@ M: word reset-word [ gensym dup ] 2dip define-declared ; : reveal ( word -- ) - dup [ name>> ] [ vocabulary>> ] bi dup vocab-words + dup [ name>> ] [ vocabulary>> ] bi dup vocab-words-assoc [ ] [ no-vocab ] ?if set-at ; @@ -242,7 +242,7 @@ M: word set-where swap "loc" set-word-prop ; M: word forget* dup "forgotten" word-prop [ drop ] [ [ subwords forget-all ] - [ [ name>> ] [ vocabulary>> vocab-words ] bi delete-at ] + [ [ name>> ] [ vocabulary>> vocab-words-assoc ] bi delete-at ] [ t "forgotten" set-word-prop ] tri ] if ; diff --git a/extra/benchmark/benchmark.factor b/extra/benchmark/benchmark.factor index b45d331df7..966d5bcabe 100644 --- a/extra/benchmark/benchmark.factor +++ b/extra/benchmark/benchmark.factor @@ -20,7 +20,7 @@ PRIVATE> compact-gc '[ _ run ] profile most-recent-profile-data ; : find-benchmark-vocabs ( -- seq ) - "benchmark" child-vocab-names + "benchmark" loaded-child-vocab-names [ find-vocab-root ] filter ; article-location fuel-eval-set-result ; : fuel-get-vocabs ( -- ) - all-vocab-names fuel-eval-set-result ; + all-disk-vocab-names fuel-eval-set-result ; : fuel-get-vocabs/prefix ( prefix -- ) get-vocabs/prefix fuel-eval-set-result ; diff --git a/extra/fuel/help/help.factor b/extra/fuel/help/help.factor index a1a6bb2344..f06f3ee133 100644 --- a/extra/fuel/help/help.factor +++ b/extra/fuel/help/help.factor @@ -1,11 +1,11 @@ ! Copyright (C) 2009 Jose Antonio Ortega Ruiz. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays assocs combinators combinators.short-circuit fry -fuel.eval help help.crossref help.markup help.markup.private help.topics io -io.streams.string kernel make namespaces parser prettyprint sequences summary -help.vocabs vocabs vocabs.loader vocabs.hierarchy vocabs.metadata -vocabs.parser words see listener sets ; -FROM: vocabs.hierarchy => child-vocabs ; +USING: accessors arrays assocs combinators +combinators.short-circuit fry help help.crossref help.markup +help.markup.private help.topics help.vocabs io io.streams.string +kernel listener make namespaces parser prettyprint see sequences +summary vocabs vocabs.hierarchy vocabs.metadata vocabs.parser +words ; IN: fuel.help map sift ; : fuel-vocab-children-help ( name -- element ) - child-vocabs fuel-vocab-list ; inline + disk-vocabs-for-prefix fuel-vocab-list ; inline : fuel-vocab-describe-words ( name -- element ) [ words. ] with-string-writer \ describe-words swap 2array ; inline diff --git a/extra/fuel/xref/xref.factor b/extra/fuel/xref/xref.factor index 3c1752257c..f7f3a724fb 100644 --- a/extra/fuel/xref/xref.factor +++ b/extra/fuel/xref/xref.factor @@ -34,7 +34,7 @@ IN: fuel.xref [ drop-prefix nip empty? ] curry filter members ; MEMO: (vocab-words) ( name -- seq ) - >vocab-link words [ name>> ] map ; + >vocab-link vocab-words [ name>> ] map ; : current-words ( -- seq ) manifest get @@ -53,7 +53,7 @@ PRIVATE> : apropos-xref ( str -- seq ) words-matching keys format-xrefs group-xrefs ; : vocab-xref ( vocab -- seq ) - dup ".private" append [ words ] bi@ append + dup ".private" append [ vocab-words ] bi@ append format-xrefs group-xrefs ; : word-location ( word -- loc ) where get-loc ; @@ -68,7 +68,7 @@ PRIVATE> : article-location ( name -- loc ) lookup-article loc>> get-loc ; -: get-vocabs/prefix ( prefix -- seq ) all-vocab-names swap filter-prefix ; +: get-vocabs/prefix ( prefix -- seq ) all-disk-vocab-names swap filter-prefix ; : get-vocabs-words/prefix ( prefix names/f -- seq ) [ vocabs-words ] [ current-words ] if* natural-sort swap filter-prefix ; diff --git a/extra/lint/lint.factor b/extra/lint/lint.factor index 2d33c03520..dee21564c2 100644 --- a/extra/lint/lint.factor +++ b/extra/lint/lint.factor @@ -1,13 +1,10 @@ ! Copyright (C) 2007, 2008, 2011 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. - -USING: accessors alien arrays assocs classes -classes.tuple.private combinators.short-circuit continuations -fry hashtables io kernel kernel.private locals.backend make math -math.private namespaces prettyprint quotations sequences -sequences.deep shuffle slots.private splitting stack-checker -vectors vocabs words words.alias ; - +USING: accessors arrays assocs classes classes.tuple.private +combinators.short-circuit continuations fry io kernel +kernel.private locals.backend make math math.private namespaces +prettyprint quotations sequences sequences.deep slots.private +splitting stack-checker vocabs words words.alias ; IN: lint all-words run-lint dup lint. ; : lint-vocab ( vocab -- seq ) - words run-lint dup lint. ; + vocab-words run-lint dup lint. ; : lint-vocabs ( prefix -- seq ) - [ vocabs ] dip [ head? ] curry filter [ lint-vocab ] map ; + [ loaded-vocab-names ] dip [ head? ] curry filter [ lint-vocab ] map ; : lint-word ( word -- seq ) 1array run-lint dup lint. ; diff --git a/extra/mongodb/tuple/persistent/persistent.factor b/extra/mongodb/tuple/persistent/persistent.factor index f5aa1c95ca..e711066fe6 100644 --- a/extra/mongodb/tuple/persistent/persistent.factor +++ b/extra/mongodb/tuple/persistent/persistent.factor @@ -1,8 +1,7 @@ -USING: accessors assocs bson.constants combinators.short-circuit -constructors continuations fry kernel mirrors mongodb.tuple.collection -mongodb.tuple.state namespaces sequences words bson.writer combinators -hashtables linked-assocs ; - +USING: accessors assocs bson.constants bson.writer combinators +combinators.short-circuit constructors continuations fry +hashtables kernel linked-assocs mirrors mongodb.tuple.collection +mongodb.tuple.state namespaces sequences words ; IN: mongodb.tuple.persistent SYMBOLS: object-map ; diff --git a/extra/readline-listener/readline-listener.factor b/extra/readline-listener/readline-listener.factor index 3d5038232b..e439a0e3d1 100644 --- a/extra/readline-listener/readline-listener.factor +++ b/extra/readline-listener/readline-listener.factor @@ -29,7 +29,7 @@ M: readline-reader prompt. all-words [ name>> ] map! prefixed ; : prefixed-vocabs ( prefix -- vocabs ) - all-vocabs-recursive filter-vocabs [ name>> ] map! prefixed ; + disk-vocabs-recursive filter-vocabs [ name>> ] map! prefixed ; : prefixed-colors ( prefix -- colors ) named-colors prefixed ; diff --git a/extra/reports/noise/noise.factor b/extra/reports/noise/noise.factor index cc6c9ee33f..63abdfe308 100644 --- a/extra/reports/noise/noise.factor +++ b/extra/reports/noise/noise.factor @@ -131,7 +131,7 @@ M: lambda-word word-noise-factor ] tabular-output ; : vocab-noise-factor ( vocab -- factor ) - words flatten-generics + vocab-words flatten-generics [ word-noise-factor dup 20 < [ drop 0 ] when ] map [ 0 ] [ [ [ sum ] [ length 5 max ] bi /i ] diff --git a/extra/slots/syntax/syntax.factor b/extra/slots/syntax/syntax.factor index 144dfc1c06..a570c4e4d4 100755 --- a/extra/slots/syntax/syntax.factor +++ b/extra/slots/syntax/syntax.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2010 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: combinators combinators.smart fry kernel lexer -quotations sequences sequences.generalizations slots words ; +USING: combinators combinators.smart fry kernel lexer quotations +sequences sequences.generalizations slots words ; IN: slots.syntax SYNTAX: slots[ diff --git a/extra/smalltalk/compiler/compiler.factor b/extra/smalltalk/compiler/compiler.factor index 8acf8d17b6..31fd6c9a55 100644 --- a/extra/smalltalk/compiler/compiler.factor +++ b/extra/smalltalk/compiler/compiler.factor @@ -1,12 +1,11 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays assocs combinators.short-circuit -continuations fry kernel namespaces quotations sequences sets -generalizations sequences.generalizations slots locals.types -splitting math locals.rewrite.closures generic words combinators -locals smalltalk.ast smalltalk.compiler.lexenv -smalltalk.compiler.assignment smalltalk.compiler.return -smalltalk.selectors smalltalk.classes ; +USING: accessors arrays assocs combinators continuations fry +generic kernel locals locals.types math quotations sequences +sequences.generalizations sets smalltalk.ast smalltalk.classes +smalltalk.compiler.assignment smalltalk.compiler.lexenv +smalltalk.compiler.return smalltalk.selectors splitting vocabs +words ; IN: smalltalk.compiler GENERIC: compile-ast ( lexenv ast -- quot ) -- 2.34.1