append-outputs-as ( quot exemplar -- seq ) (original) (raw)

append-outputs-as ( quot exemplar -- seq )
Factor handbook » The language » Combinators » Smart combinators

Prev: append-outputs ( quot -- seq )
Next: drop-outputs ( quot -- )

Vocabulary
combinators.smart

Inputs

quot a quotation
exemplar a sequence

Outputs

seq a sequence

Word description
Infers the number of outputs from quot and returns a sequence of type exemplar of the outputs appended.

Examples

USING: combinators.smart prettyprint ; [ { 1 2 } { "A" "b" } ] V{ } append-outputs-as .
V{ 1 2 "A" "b" }

See also
append-outputs

Definition

USING: kernel sequences.generalizations ;

IN: combinators.smart

: append-outputs-as ( quot exemplar -- seq )
[ [ call ] [ outputs ] bi ] dip nappend-as ; inline