]> gitweb.factorcode.org Git - factor.git/blob - basis/models/product/product-docs.factor
core, basis, extra: Remove DOS line endings from files.
[factor.git] / basis / models / product / product-docs.factor
1 USING: help.syntax help.markup kernel math classes classes.tuple
2 calendar models ;
3 IN: models.product
4
5 HELP: product
6 { $class-description "Product model values are computed by collecting the values from a sequence of underlying models into a new sequence. Product models are automatically updated when underlying models change. Product models are constructed by " { $link <product> } "."
7 $nl
8 "A product model whose children are all " { $link "models-range" } " conforms to the " { $link "range-model-protocol" } " and represents a point in n-dimensional space which is bounded by a rectangle." }
9 { $examples
10     "The following code displays a pair of sliders, and an updating label showing their current values:"
11     { $code
12         "USING: models models.product models.range ui.gadgets"
13         "ui.gadgets.labels ui.gadgets.packs ui.gadgets.panes"
14         "ui.gadgets.sliders ;"
15         ""
16         ": <funny-model> ( -- model ) 0 10 0 100 1 <range> ;"
17         ": <funny-slider> ( model -- slider ) horizontal <slider> ;"
18         ""
19         "<funny-model> <funny-model> 2array"
20         "[ <pile> [ horizontal <slider> add-gadget ] reduce gadget. ]"
21         "[ <product> [ unparse ] <arrow> <label-control> gadget. ]"
22         "bi"
23     }
24 } ;
25
26 HELP: <product>
27 { $values { "models" "a sequence of models" } { "product" "a new " { $link product } } }
28 { $description "Creates a new instance of " { $link product } ". The value of the new product model is obtained by mapping the " { $snippet "value" } " slot accessor over the given sequence of models." }
29 { $examples "See the example in the documentation for " { $link product } "." } ;
30
31 ARTICLE: "models.product" "Product models"
32 "Product model values are computed by collecting the values from a sequence of underlying models into a new sequence."
33 { $subsections
34     product
35     <product>
36 } ;
37
38 ABOUT: "models.product"