lmap ( ... list quot: ( ... elt -- ... newelt ) -- ... result )
Factor handbook » The language » Collections » Lists » Combinators for lists

Prev:leach ( ... list quot: ( ... elt -- ... ) -- ... )
Next:foldl ( ... list identity quot: ( ... prev elt -- ... next ) -- ... result )


Vocabulary
lists

Inputs
lista list
quota quotation with stack effect ( ... elt -- ... newelt )


Outputs
resultthe final result


Word description
Applies the quotation to each element of the list in order, collecting the new elements into a new list.

Definition


: lmap
( ... list quot: ( ... elt -- ... newelt ) -- ... result )
[ nil ] dip [ swapd dip cons ] curry foldl lreverse ; inline