Handbook
Glossary
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
list
a
list
quot
a
quotation
with stack effect
( ... elt -- ... newelt )
Outputs
result
the final result
Word description
Applies the quotation to each element of the list in order, collecting the new elements into a new list.
Definition
USING:
kernel
;
IN:
lists
:
lmap
( ... list quot: ( ... elt -- ... newelt ) -- ... result )
[
nil
]
dip
[
swapd
dip
cons
]
curry
foldl
lreverse
;
inline