make-list-with-proc

(make-list-with-proc k func)


Description:

Creates a list of k elements setting each element to the result of applying the function with an index argument


Arguments:

              k -- number of elements

           func -- any function taking one argument


Returns: list


Examples:

(make-list-with-proc 5 (lambda (i) (* i 2))) => (0 2 4 6 8)



Back to index