]> gitweb.factorcode.org Git - factor.git/commitdiff
core: update docs for new words
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 31 Jul 2022 17:18:41 +0000 (12:18 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 31 Jul 2022 18:26:02 +0000 (13:26 -0500)
core/math/math-docs.factor
core/sequences/sequences-docs.factor

index 82f44375fbca19c9f4b9752e486e1b8c411c85ce..1fdc0b01c64f5e09174a1094205f2edc1d1e377a 100644 (file)
@@ -449,6 +449,11 @@ HELP: all-integers?
 { $description "Applies the quotation to each integer from 0 up to " { $snippet "n" } ", excluding " { $snippet "n" } ". Iteration stops when the quotation outputs " { $link f } " or the end is reached. If the quotation yields a false value for some integer, this word outputs " { $link f } ". Otherwise, this word outputs " { $link t } "." }
 { $notes "This word is used to implement " { $link all? } "." } ;
 
+HELP: find-integer-from
+{ $values { "i" integer } { "n" integer } { "quot" { $quotation ( ... i -- ... ? ) } } { "i/f" { $maybe integer } } }
+{ $description "Applies the quotation to each integer from " { $snippet "i" } " up to " { $snippet "n" } ", excluding " { $snippet "n" } ". Iteration stops when the quotation outputs a true value or the end is reached. If the quotation yields a true value for some integer, this word outputs that integer. Otherwise, this word outputs " { $link f } "." }
+{ $notes "This word is used to implement " { $link find-integer } " and " { $link find } "." } ;
+
 HELP: find-integer
 { $values { "n" integer } { "quot" { $quotation ( ... i -- ... ? ) } } { "i/f" { $maybe integer } } }
 { $description "Applies the quotation to each integer from 0 up to " { $snippet "n" } ", excluding " { $snippet "n" } ". Iteration stops when the quotation outputs a true value or the end is reached. If the quotation yields a true value for some integer, this word outputs that integer. Otherwise, this word outputs " { $link f } "." }
index 3d7767b3eeec7b40efe08651a95c49c7c71ee398..6858135aa33edb0024d7859ebd4a0a55f39dbc08 100644 (file)
@@ -1210,6 +1210,10 @@ HELP: subseq?
 { $values { "subseq" sequence } { "seq" sequence } { "?" boolean } }
 { $description "Tests if " { $snippet "seq" } " contains the elements of " { $snippet "subseq" } " as a contiguous subsequence." } ;
 
+HELP: subseq-index?
+{ $values { "seq" sequence } { "subseq" sequence } { "?" boolean } }
+{ $description "Tests if " { $snippet "seq" } " contains the elements of " { $snippet "subseq" } " as a contiguous subsequence." } ;
+
 HELP: drop-prefix
 { $values { "seq1" sequence } { "seq2" sequence } { "slice1" "a slice" } { "slice2" "a slice" } }
 { $description "Outputs a pair of virtual sequences with the common prefix of " { $snippet "seq1" } " and " { $snippet "seq2" } " removed." } ;
@@ -1934,7 +1938,7 @@ ARTICLE: "sequences-tests" "Testing sequences"
 "Testing if a sequence contains an object:"
 { $subsections member? member-eq? }
 "Testing if a sequence contains a subsequence:"
-{ $subsections head? tail? subseq? } ;
+{ $subsections head? tail? subseq? subseq-index? } ;
 
 ARTICLE: "sequences-search" "Searching sequences"
 "Finding the index of an element:"