output>sequence ( quot exemplar -- seq )
Factor documentation > Factor handbook > The language > Combinators > Smart combinators
Prev:input<sequence-unsafe ( seq quot -- )
Next:output>array ( quot -- array )


Vocabulary
combinators.smart

Inputs and outputs
quota quotation
exemplaran exemplar
seqa sequence


Word description
Infers the number of outputs from the quotation and constructs a new sequence from those objects of the same type as the exemplar.

Examples
USING: combinators.smart kernel math prettyprint ; 4 [ [ 1 + ] [ 2 + ] [ 3 + ] tri ] V{ } output>sequence .
V{ 5 6 7 }


Definition
USING: kernel sequences.generalizations ;

IN: combinators.smart

: output>sequence ( quot exemplar -- seq )
[ [ call ] [ outputs ] bi ] dip nsequence ; inline