Adding docs on null? and the changes for require-when
parent
aa6158b366
commit
26c3bf2611
|
@ -23,6 +23,8 @@ ARTICLE: "set-operations" "Operations on sets"
|
||||||
adjoin
|
adjoin
|
||||||
delete
|
delete
|
||||||
}
|
}
|
||||||
|
"To test if a set is the empty set:"
|
||||||
|
{ $subsections null? }
|
||||||
"Basic mathematical operations, which any type of set may override for efficiency:"
|
"Basic mathematical operations, which any type of set may override for efficiency:"
|
||||||
{ $subsections
|
{ $subsections
|
||||||
diff
|
diff
|
||||||
|
@ -178,3 +180,7 @@ HELP: within
|
||||||
HELP: without
|
HELP: without
|
||||||
{ $values { "seq" sequence } { "set" set } { "subseq" sequence } }
|
{ $values { "seq" sequence } { "set" set } { "subseq" sequence } }
|
||||||
{ $description "Returns the subsequence of the given sequence consisting of things that are not members of the set. This may contain duplicates, if the sequence has duplicates." } ;
|
{ $description "Returns the subsequence of the given sequence consisting of things that are not members of the set. This may contain duplicates, if the sequence has duplicates." } ;
|
||||||
|
|
||||||
|
HELP: null?
|
||||||
|
{ $values { "set" set } { "?" "a boolean" } }
|
||||||
|
{ $description "Tests whether the given set is empty. This outputs " { $snippet "t" } " when given a null set of any type." } ;
|
||||||
|
|
|
@ -114,10 +114,10 @@ HELP: require
|
||||||
{ $notes "To unconditionally reload a vocabulary, use " { $link reload } ". To reload changed source files only, use the words in " { $link "vocabs.refresh" } "." } ;
|
{ $notes "To unconditionally reload a vocabulary, use " { $link reload } ". To reload changed source files only, use the words in " { $link "vocabs.refresh" } "." } ;
|
||||||
|
|
||||||
HELP: require-when
|
HELP: require-when
|
||||||
{ $values { "if" "a vocabulary specifier" } { "then" "a vocabulary specifier" } }
|
{ $values { "if" "a sequence of vocabulary specifiers" } { "then" "a vocabulary specifier" } }
|
||||||
{ $description "Loads the " { $snippet "then" } " vocabulary if it is not loaded and the " { $snippet "if" } " vocabulary is. If the " { $snippet "if" } " vocabulary is not loaded now, but it is later, then the " { $snippet "then" } " vocabulary will be loaded along with it at that time." }
|
{ $description "Loads the " { $snippet "then" } " vocabulary if it is not loaded and all of the " { $snippet "if" } " vocabulary is. If some of the " { $snippet "if" } " vocabularies are not loaded now, but they are later, then the " { $snippet "then" } " vocabulary will be loaded along with the final one." }
|
||||||
{ $notes "This is used to express a joint dependency of vocabularies. If vocabularies " { $snippet "a" } " and " { $snippet "b" } " use code in vocabulary " { $snippet "c" } " to interact, then the following line can be placed in " { $snippet "a" } " in order express the dependency."
|
{ $notes "This is used to express a joint dependency of vocabularies. If vocabularies " { $snippet "a" } " and " { $snippet "b" } " use code in vocabulary " { $snippet "c" } " to interact, then the following line, which can be placed in " { $snippet "a" } " or " { $snippet "b" } ", expresses the dependency."
|
||||||
{ $code "\"b\" \"c\" require-when" } } ;
|
{ $code "{ \"a\" \"b\" } \"c\" require-when" } } ;
|
||||||
|
|
||||||
HELP: run
|
HELP: run
|
||||||
{ $values { "vocab" "a vocabulary specifier" } }
|
{ $values { "vocab" "a vocabulary specifier" } }
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
USING: namespaces make sequences io io.files io.pathnames kernel
|
USING: namespaces make sequences io io.files io.pathnames kernel
|
||||||
assocs words vocabs definitions parser continuations hashtables
|
assocs words vocabs definitions parser continuations hashtables
|
||||||
sorting source-files arrays combinators strings system
|
sorting source-files arrays combinators strings system
|
||||||
math.parser splitting init accessors sets fry ;
|
math.parser splitting init accessors sets ;
|
||||||
IN: vocabs.loader
|
IN: vocabs.loader
|
||||||
|
|
||||||
SYMBOL: vocab-roots
|
SYMBOL: vocab-roots
|
||||||
|
@ -76,7 +76,7 @@ require-when-table [ V{ } clone ] initialize
|
||||||
vocab-name require-when-vocabs get in? [
|
vocab-name require-when-vocabs get in? [
|
||||||
require-when-table get [
|
require-when-table get [
|
||||||
[ [ vocab ] all? ] dip
|
[ [ vocab ] all? ] dip
|
||||||
'[ _ require ] when
|
[ require ] curry when
|
||||||
] assoc-each
|
] assoc-each
|
||||||
] when ;
|
] when ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue