diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index 1e966c143d..aeab243a2f 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -1191,7 +1191,8 @@ HELP: 2map-reduce { $values { "seq1" sequence } { "seq2" sequence } { "map-quot" quotation } { "reduce-quot" quotation } { "result" object } } -{ $description "Unclips the first element of each sequence and calls " { $snippet "map-quot" } " on both objects. The result of this calculation is passed, along with the rest of both sequences, to " { $link 2reduce } ", with the computed object as the identity." } + { $description "Calls " { $snippet "map-quot" } " on each pair of elements from " { $snippet "seq1" } " and " { $snippet "seq2" } " 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." } { $examples { $example "USING: sequences prettyprint math ;" "{ 10 30 50 } { 200 400 600 } [ + ] [ + ] 2map-reduce ." "1290" @@ -1289,7 +1290,8 @@ HELP: map-reduce { $values { "seq" sequence } { "map-quot" quotation } { "reduce-quot" quotation } { "result" object } } -{ $description "Unclips the first element of the sequence, calls " { $snippet "map-quot" } " on that element, and proceeds like a " { $link reduce } ", where the calculated element is the identity element and the rest of the sequence is the sequence to reduce." } +{ $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." } { $examples { $example "USING: sequences prettyprint math ;" "{ 1 3 5 } [ sq ] [ + ] map-reduce ." "35"