make ( quot exemplar -- seq )
Factor handbook » The language » Collections » Making sequences with variables

Next:, ( elt -- )


Vocabulary
make

Inputs
quota quotation
exemplara sequence


Outputs
seqa new sequence


Word description
Calls the quotation in a new dynamic scope with the building variable bound to a new resizable mutable sequence. The quotation and any words it calls can execute the , and % words to accumulate elements into a sequence (or ,, and %% into an assoc). When the quotation returns, all accumulated elements are collected into an object with the same type as exemplar.

Examples
USING: make prettyprint ; [ 1 , 2 , 3 , ] { } make .
{ 1 2 3 }

USING: make prettyprint ; [ 2 1 ,, 4 3 ,, ] H{ } make .
H{ { 1 2 } { 3 4 } }


Definition