]> gitweb.factorcode.org Git - factor.git/commitdiff
math: use "i/f" for stack effect.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 30 Sep 2015 04:25:11 +0000 (21:25 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 1 Oct 2015 02:01:38 +0000 (19:01 -0700)
core/math/math-docs.factor
core/math/math.factor

index 96c63cb0fef7b91a192b2b3e958705a7eb1eb883..0bc2d6f083ec4a0ce5c5b47fd1d0666ddefc2750 100644 (file)
@@ -436,12 +436,12 @@ HELP: all-integers?
 { $notes "This word is used to implement " { $link all? } "." } ;
 
 HELP: find-integer
-{ $values { "n" integer } { "quot" { $quotation ( ... i -- ... ? ) } } { "i" { $maybe 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 } "." }
 { $notes "This word is used to implement " { $link find } "." } ;
 
 HELP: find-last-integer
-{ $values { "n" integer } { "quot" { $quotation ( ... i -- ... ? ) } } { "i" { $maybe integer } } }
+{ $values { "n" integer } { "quot" { $quotation ( ... i -- ... ? ) } } { "i/f" { $maybe integer } } }
 { $description "Applies the quotation to each integer from " { $snippet "n" } " down to 0, inclusive. Iteration stops when the quotation outputs a true value or 0 is reached. If the quotation yields a true value for some integer, the word outputs that integer. Otherwise, the word outputs " { $link f } "." }
 { $notes "This word is used to implement " { $link find-last } "." } ;
 
index 92d8326b5c15c2e6caabad4c77385c197506f0ae..23f4d10a1e62438d17e916773d9c928146dab5fd 100644 (file)
@@ -284,13 +284,13 @@ PRIVATE>
 : times ( ... n quot: ( ... -- ... ) -- ... )
     [ drop ] prepose each-integer ; inline
 
-: find-integer ( ... n quot: ( ... i -- ... ? ) -- ... i )
+: find-integer ( ... n quot: ( ... i -- ... ? ) -- ... i/f )
     iterate-prep (find-integer) ; inline
 
 : all-integers? ( ... n quot: ( ... i -- ... ? ) -- ... ? )
     iterate-prep (all-integers?) ; inline
 
-: find-last-integer ( ... n quot: ( ... i -- ... ? ) -- ... i )
+: find-last-integer ( ... n quot: ( ... i -- ... ? ) -- ... i/f )
     over 0 < [
         2drop f
     ] [