]> gitweb.factorcode.org Git - factor.git/blob - extra/sequences/lib/lib-docs.factor
FUEL: Fix bug whereby true display-stacks? could hang the listener.
[factor.git] / extra / sequences / lib / lib-docs.factor
1 USING: help.syntax help.markup kernel prettyprint sequences\r
2 quotations math ;\r
3 IN: sequences.lib\r
4 \r
5 HELP: map-withn\r
6 { $values { "seq" sequence } { "quot" quotation } { "n" number } { "newseq" sequence } }\r
7 { $description "A generalisation of " { $link map } ". The first " { $snippet "n" } " items after the quotation will be "\r
8 "passed to the quotation given to map-withn for each element in the sequence."\r
9\r
10 { $examples\r
11   { $example "USING: math sequences.lib prettyprint ;" "1 2 3 4 { 6 7 8 9 10 } [ + + + + ] 4 map-withn .s" "{ 16 17 18 19 20 }" }\r
12 }\r
13 { $see-also each-withn } ;\r
14 \r
15 HELP: each-withn\r
16 { $values { "seq" sequence } { "quot" quotation } { "n" number } }\r
17 { $description "A generalisation of " { $link each } ". The first " { $snippet "n" } " items after the quotation will be "\r
18 "passed to the quotation given to each-withn for each element in the sequence."\r
19\r
20 { $see-also map-withn } ;\r
21 \r
22 HELP: randomize\r
23 { $values { "seq" sequence } { "seq'" sequence } }\r
24 { $description "Shuffle the elements in the sequence randomly, returning the new sequence." } ;\r
25 \r
26 HELP: enumerate\r
27 { $values { "seq" sequence } { "seq'" sequence } }\r
28 { $description "Returns a new sequence where each element is an array of { index, value }" } ;\r
29 \r