]> gitweb.factorcode.org Git - factor.git/blob - basis/models/arrow/arrow-docs.factor
2dbcda036f9b4156a09e90af5eae2cfb57a77a85
[factor.git] / basis / models / arrow / arrow-docs.factor
1 USING: help.syntax help.markup kernel math classes classes.tuple\r
2 calendar models ;\r
3 IN: models.arrow\r
4 \r
5 HELP: arrow\r
6 { $class-description "Arrow model values are computed by applying a quotation to the value of another model. Arrows are automatically updated when the underlying model changes. Arrows are constructed by " { $link <arrow> } "." }\r
7 { $examples\r
8     "The following code displays a label showing the result of applying " { $link sq } " to the value 5:"\r
9     { $code\r
10         "USING: models ui.gadgets.labels ui.gadgets.panes ;"\r
11         "5 <model> [ sq ] <arrow> [ number>string ] <arrow>"\r
12         "<label-control> gadget."\r
13     }\r
14     "An exercise for the reader is to keep the original model around on the stack, and change its value to 6, observing that the label will immediately display 36."\r
15 } ;\r
16 \r
17 HELP: <arrow>\r
18 { $values { "model" model } { "quot" { $quotation ( obj -- newobj ) } } { "arrow" "a new " { $link arrow } } }\r
19 { $description "Creates a new instance of " { $link arrow } ". The value of the new arrow model is computed by applying the quotation to the value." }\r
20 { $examples "See the example in the documentation for " { $link arrow } "." } ;\r
21 \r
22 ARTICLE: "models.arrow" "Arrow models"\r
23 "Arrow model values are computed by applying a quotation to the value of another model."\r
24 { $subsections\r
25     arrow\r
26     <arrow>\r
27 } ;\r
28 \r
29 ABOUT: "models.arrow"\r