sequences: fix map-reduce and 2map-reduce docs, reported by Ben Schlingelhof

db4
Slava Pestov 2009-12-12 15:16:11 -05:00
parent 0d6546e994
commit 4cea294cfd
1 changed files with 4 additions and 2 deletions

View File

@ -1191,7 +1191,8 @@ HELP: 2map-reduce
{ $values { $values
{ "seq1" sequence } { "seq2" sequence } { "map-quot" quotation } { "reduce-quot" quotation } { "seq1" sequence } { "seq2" sequence } { "map-quot" quotation } { "reduce-quot" quotation }
{ "result" object } } { "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 ;" { $examples { $example "USING: sequences prettyprint math ;"
"{ 10 30 50 } { 200 400 600 } [ + ] [ + ] 2map-reduce ." "{ 10 30 50 } { 200 400 600 } [ + ] [ + ] 2map-reduce ."
"1290" "1290"
@ -1289,7 +1290,8 @@ HELP: map-reduce
{ $values { $values
{ "seq" sequence } { "map-quot" quotation } { "reduce-quot" quotation } { "seq" sequence } { "map-quot" quotation } { "reduce-quot" quotation }
{ "result" object } } { "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 ;" { $examples { $example "USING: sequences prettyprint math ;"
"{ 1 3 5 } [ sq ] [ + ] map-reduce ." "{ 1 3 5 } [ sq ] [ + ] map-reduce ."
"35" "35"