]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences: change stack effect docs for map-reduce to be more consistent.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 27 Sep 2012 18:14:21 +0000 (11:14 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 27 Sep 2012 18:14:21 +0000 (11:14 -0700)
core/sequences/sequences-docs.factor
core/sequences/sequences.factor

index 84522ec46a91d071a5a2f5b9083ecb9c8215e428..4000802a9b31ec6f5b6e496f11b7597b943084d0 100644 (file)
@@ -1344,7 +1344,7 @@ HELP: insert-nth
 
 HELP: map-reduce
 { $values
-     { "seq" sequence } { "map-quot" { $quotation "( ..a x -- ..b elt )" } } { "reduce-quot" { $quotation "( ..b prev elt -- ..a next )" } }
+     { "seq" sequence } { "map-quot" { $quotation "( ..a elt -- ..b intermediate )" } } { "reduce-quot" { $quotation "( ..b prev intermediate -- ..a next )" } }
      { "result" object } }
 { $description "Calls " { $snippet "map-quot" } " on each element and combines the results using " { $snippet "reduce-quot" } " in the same manner as " { $link reduce } ", except that there is no identity element, and the sequence must have a length of at least 1." }
 { $errors "Throws an error if the sequence is empty." }
index 3327bdd701a1cae4797b6f9bde55ea3c91bd3cf8..76b55928ee8f4baf6f3f17c086daf4fc61c3d406 100644 (file)
@@ -924,7 +924,7 @@ PRIVATE>
 : unclip-slice ( seq -- rest-slice first )
     [ rest-slice ] [ first-unsafe ] bi ; inline
 
-: map-reduce ( ..a seq map-quot: ( ..a x -- ..b elt ) reduce-quot: ( ..b prev elt -- ..a next ) -- ..a result )
+: map-reduce ( ..a seq map-quot: ( ..a elt -- ..b intermediate ) reduce-quot: ( ..b prev intermediate -- ..a next ) -- ..a result )
     [ [ dup first ] dip [ call ] keep ] dip compose
     swapd [ 1 ] 2dip (each) (each-integer) ; inline