"." write flush
- vocabs [ words compile-unoptimized "." write flush ] each
+ loaded-vocab-names [ vocab-words compile-unoptimized "." write flush ] each
" done" print flush
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 ;
SYMBOL: editor-class
: available-editors ( -- seq )
- "editors" child-vocab-names ;
+ "editors" loaded-child-vocab-names ;
: editor-restarts ( -- alist )
available-editors
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 )
M: simple-lint-error error. summary print ;
SYMBOL: vocabs-quot
-SYMBOL: all-vocabs
+SYMBOL: all-vocabs-list
SYMBOL: vocab-articles
: check-example ( element -- )
[ "$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 [
} 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 ;
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
: 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 ;
: 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 ;
: :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
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 -- )
] unless-empty ;
: describe-children ( vocab -- )
- vocab-name child-vocabs
+ vocab-name disk-vocabs-for-prefix
$vocab-roots ;
: files. ( seq -- )
: 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 -- )
[
} 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
! 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 ;
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 -- )
[
{ "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
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 ;
! 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? ;
".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>
{ [ ".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 )
[ "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?
: 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 -- )
] 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 )
: 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 ;
: 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 )
[ ]
[ docs-header. ] [ docs-body. ] bi ;
: interesting-words ( vocab -- array )
- words
+ vocab-words
[ { [ "help" word-prop ] [ predicate? ] } 1|| ] reject
natural-sort ;
: :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 ;
<<
"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"
\ 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 ;
}\r
"Getting all vocabularies from disk:"\r
{ $subsections\r
- all-vocabs\r
- all-vocabs-recursive\r
+ all-disk-vocabs-by-root\r
+ all-disk-vocabs-recursive\r
}\r
"Getting all vocabularies from disk whose names which match a string prefix:"\r
{ $subsections\r
- child-vocabs\r
- child-vocabs-recursive\r
+ disk-vocabs-for-prefix\r
+ disk-vocabs-recursive-for-prefix\r
}\r
"Words for modifying output:"\r
{ $subsections\r
io.directories io.files io.files.types io.pathnames kernel make\r
memoize namespaces sequences sorting splitting vocabs sets\r
vocabs.loader vocabs.metadata vocabs.errors ;\r
-RENAME: child-vocabs vocabs => vocabs:child-vocabs\r
IN: vocabs.hierarchy\r
\r
TUPLE: vocab-prefix name ;\r
: ensure-vocab-root/prefix ( root prefix -- root prefix )\r
[ ensure-vocab-root ] [ check-vocab-name ] bi* ;\r
\r
-: (child-vocabs) ( root prefix -- vocabs )\r
+: (disk-vocab-children) ( root prefix -- vocabs )\r
check-vocab-name\r
[ vocab-dir append-path dup exists? [ vocab-subdirs ] [ drop { } ] if ]\r
[ nip [ "." append '[ _ prepend ] map! ] unless-empty ]\r
[ drop '[ _ over vocab-dir? [ >vocab-link ] [ <vocab-prefix> ] if ] map! ]\r
2tri ;\r
\r
-: ((child-vocabs-recursive)) ( root prefix -- )\r
- dupd vocab-name (child-vocabs) [ % ] keep\r
- [ ((child-vocabs-recursive)) ] with each ;\r
+: ((disk-vocabs-recursive)) ( root prefix -- )\r
+ dupd vocab-name (disk-vocab-children) [ % ] keep\r
+ [ ((disk-vocabs-recursive)) ] with each ;\r
\r
-: (child-vocabs-recursive) ( root prefix -- seq )\r
+: (disk-vocabs-recursive) ( root prefix -- seq )\r
[ ensure-vocab-root ] dip\r
- [ ((child-vocabs-recursive)) ] { } make ;\r
+ [ ((disk-vocabs-recursive)) ] { } make ;\r
\r
: no-rooted ( seq -- seq' ) [ find-vocab-root ] reject ;\r
\r
: one-level-only? ( name prefix -- ? )\r
?head [ "." split1 nip not ] [ drop f ] if ;\r
\r
-: unrooted-child-vocabs ( prefix -- seq )\r
- [ vocabs no-rooted ] dip\r
+: unrooted-disk-vocabs ( prefix -- seq )\r
+ [ loaded-vocab-names no-rooted ] dip\r
dup empty? [ CHAR: . suffix ] unless\r
'[ vocab-name _ one-level-only? ] filter ;\r
\r
-: unrooted-child-vocabs-recursive ( prefix -- seq )\r
- vocabs:child-vocabs no-rooted ;\r
+: unrooted-disk-vocabs-recursive ( prefix -- seq )\r
+ loaded-child-vocab-names no-rooted ;\r
\r
PRIVATE>\r
\r
: filter-vocabs ( assoc -- seq )\r
no-roots no-prefixes members ;\r
\r
-: child-vocabs ( prefix -- assoc )\r
- [ [ vocab-roots get ] dip '[ dup _ (child-vocabs) ] { } map>assoc ]\r
- [ unrooted-child-vocabs [ lookup-vocab ] map! f swap 2array ]\r
+: disk-vocabs-for-prefix ( prefix -- assoc )\r
+ [ [ vocab-roots get ] dip '[ dup _ (disk-vocab-children) ] { } map>assoc ]\r
+ [ unrooted-disk-vocabs [ lookup-vocab ] map! f swap 2array ]\r
bi suffix ;\r
\r
-: all-vocabs ( -- assoc )\r
- "" child-vocabs ;\r
+: all-disk-vocabs-by-root ( -- assoc )\r
+ "" disk-vocabs-for-prefix ;\r
\r
-: child-vocabs-recursive ( prefix -- assoc )\r
- [ [ vocab-roots get ] dip '[ dup _ (child-vocabs-recursive) ] { } map>assoc ]\r
- [ unrooted-child-vocabs-recursive [ lookup-vocab ] map! f swap 2array ]\r
+: disk-vocabs-recursive-for-prefix ( prefix -- assoc )\r
+ [ [ vocab-roots get ] dip '[ dup _ (disk-vocabs-recursive) ] { } map>assoc ]\r
+ [ unrooted-disk-vocabs-recursive [ lookup-vocab ] map! f swap 2array ]\r
bi suffix ;\r
\r
-MEMO: all-vocabs-recursive ( -- assoc )\r
- "" child-vocabs-recursive ;\r
+MEMO: all-disk-vocabs-recursive ( -- assoc )\r
+ "" disk-vocabs-recursive-for-prefix ;\r
\r
-: all-vocab-names ( -- seq )\r
- all-vocabs-recursive filter-vocabs [ vocab-name ] map! ;\r
+: all-disk-vocab-names ( -- seq )\r
+ all-disk-vocabs-recursive filter-vocabs [ vocab-name ] map! ;\r
\r
-: child-vocab-names ( prefix -- seq )\r
- child-vocabs filter-vocabs [ vocab-name ] map! ;\r
+: disk-child-vocab-names ( prefix -- seq )\r
+ disk-vocabs-for-prefix filter-vocabs [ vocab-name ] map! ;\r
\r
<PRIVATE\r
\r
: collect-vocabs ( quot -- seq )\r
- [ all-vocabs-recursive filter-vocabs ] dip\r
+ [ all-disk-vocabs-recursive filter-vocabs ] dip\r
gather natural-sort ; inline\r
\r
: maybe-include-root/prefix ( root prefix -- vocab-link/f )\r
\r
PRIVATE>\r
\r
-: vocabs-in-root/prefix ( root prefix -- seq )\r
- [ (child-vocabs-recursive) ]\r
+: disk-vocabs-in-root/prefix ( root prefix -- seq )\r
+ [ (disk-vocabs-recursive) ]\r
[ maybe-include-root/prefix [ prefix ] when* ] 2bi ;\r
\r
-: vocabs-in-root ( root -- seq )\r
- "" vocabs-in-root/prefix ;\r
+: disk-vocabs-in-root ( root -- seq )\r
+ "" disk-vocabs-in-root/prefix ;\r
\r
: (load-from-root) ( root prefix -- failures )\r
- vocabs-in-root/prefix\r
+ disk-vocabs-in-root/prefix\r
[ don't-load? ] reject no-prefixes\r
require-all ;\r
\r
: init-vocab-monitor ( -- )
H{ } clone changed-vocabs set-global
- vocabs [ changed-vocab ] each ;
+ loaded-vocab-names [ changed-vocab ] each ;
[
"-no-monitors" (command-line) member? [
[ 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
! 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
"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
[ [ 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
[ [ 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
[ 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
USING: help.markup help.syntax strings words compiler.units
-vocabs.loader ;
+vocabs.loader assocs ;
IN: vocabs
ARTICLE: "vocabularies" "Vocabularies"
"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
}
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." } ;
{ $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
{ $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\" }"
}
} ;
: 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 )
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 )
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 -- ? )
] 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 )
M: object >vocab-link dup lookup-vocab [ ] [ <vocab-link> ] ?if ;
: forget-vocab ( vocab -- )
- [ words forget-all ]
+ [ vocab-words forget-all ]
[ vocab-name dictionary get delete-at ]
[ notify-vocab-observers ] tri ;
"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
"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
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 ;
[ 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 ;
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 ;
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 ;
<PRIVATE
M: x30 g ;
: my-classes ( -- seq )
- "benchmark.dispatch1" words [ tuple-class? ] filter ;
+ "benchmark.dispatch1" vocab-words [ tuple-class? ] filter ;
: a-bunch-of-objects ( -- seq )
my-classes [ new ] map ;
INSTANCE: x30 g\r
\r
: my-classes ( -- seq )\r
- "benchmark.dispatch5" words [ tuple-class? ] filter ;\r
+ "benchmark.dispatch5" vocab-words [ tuple-class? ] filter ;\r
\r
: a-bunch-of-objects ( -- seq )\r
my-classes [ new ] map ;\r
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 ;
! 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
<PRIVATE
] { } assoc>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
[ 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
: 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 ;
: 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 ;
! 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
<PRIVATE
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. ;
-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 ;
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 ;
] tabular-output ;\r
\r
: vocab-noise-factor ( vocab -- factor )\r
- words flatten-generics\r
+ vocab-words flatten-generics\r
[ word-noise-factor dup 20 < [ drop 0 ] when ] map\r
[ 0 ] [\r
[ [ sum ] [ length 5 max ] bi /i ]\r
! 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[
! 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 )