]> gitweb.factorcode.org Git - factor.git/blob - core/make/make-docs.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / core / make / make-docs.factor
1 IN: make
2 USING: help.markup help.syntax quotations sequences math.parser
3 kernel ;
4
5 ARTICLE: "namespaces-make" "Making sequences with variables"
6 "The " { $vocab-link "make" } " vocabulary implements a facility for constructing sequences by holding an accumulator sequence in a variable. Storing the accumulator sequence in a variable rather than the stack may allow code to be written with less stack manipulation."
7 { $subsection make }
8 { $subsection , }
9 { $subsection % }
10 { $subsection # }
11 "The accumulator sequence can be accessed directly:"
12 { $subsection building } ;
13
14 ABOUT: "namespaces-make"
15
16 HELP: building
17 { $var-description "Temporary mutable growable sequence holding elements accumulated so far by " { $link make } "." } ;
18
19 HELP: make
20 { $values { "quot" quotation } { "exemplar" sequence } { "seq" "a new sequence" } }
21 { $description "Calls the quotation in a new " { $emphasis "dynamic scope" } ". The quotation and any words it calls can execute the " { $link , } " and " { $link % } " words to accumulate elements. When the quotation returns, all accumulated elements are collected into a sequence with the same type as " { $snippet "exemplar" } "." }
22 { $examples { $example "USING: namespaces prettyprint ;" "[ 1 , 2 , 3 , ] { } make ." "{ 1 2 3 }" } } ;
23
24 HELP: ,
25 { $values { "elt" object } }
26 { $description "Adds an element to the end of the sequence being constructed by " { $link make } "." } ;
27
28 HELP: %
29 { $values { "seq" sequence } }
30 { $description "Appends a sequence to the end of the sequence being constructed by " { $link make } "." } ;