mapcan
mapcan(u_funcl_arg1[l_arg2... ] ) =>l_result
Description
Applies a function to successive elements of the argument lists and returns the result of appending these intermediate results. All of the lists should have the same length.
Specifically, a function is applied to the car of all the argument lists, passed in the same order as the argument lists. The second elements are processed next, continuing until the last element is processed. The result of each call to u_func must be a list. These lists are destructively modified and concatenated so that the resulting list of all the concatenations is the result of mapcan. The argument u_func must accept as many arguments as there are lists.
Arguments
|
Additional argument lists, which must be the same length as l_arg1. |
Value Returned
Examples
mapcan( 'list '(1 2 3) '(a b c) )
=> (1 a 2 b 3 c)
mapcan( (lambda (n) (and (plusp n) (list n))) '(1 -2 3 -4 5))
=> (1 3 5)
Related Topics
Return to top