]> gitweb.factorcode.org Git - factor.git/commitdiff
Adding docs on null? and the changes for require-when
authorDaniel Ehrenberg <littledan@pool-224-36.res.carleton.edu>
Sun, 18 Apr 2010 19:44:52 +0000 (14:44 -0500)
committerDaniel Ehrenberg <littledan@pool-224-36.res.carleton.edu>
Sun, 18 Apr 2010 19:44:52 +0000 (14:44 -0500)
core/sets/sets-docs.factor
core/vocabs/loader/loader-docs.factor
core/vocabs/loader/loader.factor

index 5bde8a1febce4e5a09f3e661ba22fce2f3e0b217..5ae96417349cea718d5660ad704efa89e6eba197 100644 (file)
@@ -23,6 +23,8 @@ ARTICLE: "set-operations" "Operations on sets"
     adjoin
     delete
 }
+"To test if a set is the empty set:"
+{ $subsections null? }
 "Basic mathematical operations, which any type of set may override for efficiency:"
 { $subsections
     diff
@@ -178,3 +180,7 @@ HELP: within
 HELP: without
 { $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." } ;
+
+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." } ;
index d5a6be53359b0867660beca3966508fb226d763b..423abbc277b4d6159497fdea711aba54f888eaaa 100755 (executable)
@@ -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" } "." } ;
 
 HELP: require-when
-{ $values { "if" "a vocabulary specifier" } { "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." }
-{ $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."
-{ $code "\"b\" \"c\" require-when" } } ;
+{ $values { "if" "a sequence of vocabulary specifiers" } { "then" "a vocabulary specifier" } }
+{ $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, which can be placed in " { $snippet "a" } " or " { $snippet "b" } ", expresses the dependency."
+{ $code "{ \"a\" \"b\" } \"c\" require-when" } } ;
 
 HELP: run
 { $values { "vocab" "a vocabulary specifier" } }
index b09ba8c2bc4b383db0d2c284b2136d7d96b7a132..2945736f3cf7033ddedabe3e5f0ef3bff8dcfe9f 100644 (file)
@@ -3,7 +3,7 @@
 USING: namespaces make sequences io io.files io.pathnames kernel
 assocs words vocabs definitions parser continuations hashtables
 sorting source-files arrays combinators strings system
-math.parser splitting init accessors sets fry ;
+math.parser splitting init accessors sets ;
 IN: vocabs.loader
 
 SYMBOL: vocab-roots
@@ -76,7 +76,7 @@ require-when-table [ V{ } clone ] initialize
     vocab-name require-when-vocabs get in? [
         require-when-table get [
             [ [ vocab ] all? ] dip
-            '[ _ require ] when
+            [ require ] curry when
         ] assoc-each
     ] when ;