]> gitweb.factorcode.org Git - factor.git/blob - extra/changer/changer-docs.factor
factor: trim more using lists.
[factor.git] / extra / changer / changer-docs.factor
1 ! Copyright (C) 2015 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax quotations strings ;
4 IN: changer
5
6 HELP: change:
7 { $description "Syntax word for applying a quotation to a tuple slot." }
8 { $examples
9     "Change a tuple slot:"
10     { $example
11         "USING: prettyprint changer kernel math ;"
12         "IN: changer"
13         "TUPLE: nightclub count ;"
14         "T{ nightclub f 0 } [ 3 + ] change: count ."
15         "T{ nightclub { count 3 } }"
16     }
17 } ;
18
19 HELP: inline-changer
20 { $values
21     { "name" string }
22     { "quot'" quotation }
23 }
24 { $description "A macro that takes a slot name and applies the quotation to a slot of a tuple." } ;
25
26 ARTICLE: "changer" "Changer syntax"
27 "The " { $vocab-link "changer" } " vocabulary defines one word to change the values of a slot of tuple objects."
28 $nl
29 "Syntax word to change tuple slots:"
30 { $subsections
31     POSTPONE: change:
32 }
33 "Macro to implement " { $link POSTPONE: change: } ":"
34 { $subsections
35     inline-changer
36 } ;
37
38 ABOUT: "changer"