]> gitweb.factorcode.org Git - factor.git/commitdiff
Documentation fixes
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 5 Jun 2008 20:29:38 +0000 (15:29 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 5 Jun 2008 20:29:38 +0000 (15:29 -0500)
core/assocs/assocs-docs.factor
core/syntax/syntax-docs.factor

index 68be9c9b06fa83a94af72468069d1e61b54b8683..d66043678311adc3bd8ffc69ab9db294882f0d67 100755 (executable)
@@ -139,7 +139,7 @@ HELP: new-assoc
 
 HELP: assoc-find
 { $values { "assoc" assoc } { "quot" "a quotation with stack effect " { $snippet "( key value -- ? )" } } { "key" "the successful key, or f" } { "value" "the successful value, or f" } { "?" "a boolean" } }
-{ $contract "Applies a predicate quotation to each entry in the assoc. Returns the key or value that the quotation succeeds on, or " { $link f } " for both if the quotation fails. It also returns a boolean describing whether there was anything found." }
+{ $contract "Applies a predicate quotation to each entry in the assoc. Returns the key and value that the quotation succeeds on, or " { $link f } " for both if the quotation fails. It also returns a boolean describing whether there was anything found; this can be used to distinguish between a key and a value equal to " { $link f } ", or nothing being found." }
 { $notes "The " { $link assoc } " mixin has a default implementation for this generic word which first converts the assoc to an association list, then iterates over that with the " { $link find } " combinator for sequences." } ;
 
 HELP: clear-assoc
index 18595aaab3ee26ea44479ad311c94da63a5005ca..314d9697e70b2f443de07d9d81e64d6bda8614e9 100755 (executable)
@@ -526,6 +526,9 @@ HELP: PREDICATE:
         "it satisfies the predicate"
     }
     "Each predicate must be defined as a subclass of some other class. This ensures that predicates inheriting from disjoint classes do not need to be exhaustively tested during method dispatch."
+}
+{ $examples
+    { $code "USING: math ;" "PREDICATE: positive < integer 0 > ;" }
 } ;
 
 HELP: TUPLE: