collect ( n quot into -- )


Vocabulary
sequences.private

Inputs
na non-negative integer
quota quotation with stack effect ( ... n -- ... value )
intoa sequence of length at least n


Outputs
None

Word description
A primitive mapping operation that applies a quotation to all integers from 0 up to but not including n, and collects the results in a new array. User code should use map instead.

Examples
USING: kernel math.parser prettyprint sequences sequences.private ; 10 [ number>string ] 10 f new-sequence [ collect ] keep .
{ "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" }


Definition