Clamps Dictionary
call/collecting
Function
(call/collecting f n &optional (tail '()))
Call function f n times, with idx [0..n-1] as argument, collecting its results. Return results with tail appended.
Arguments
f |
Function of one argument (an integer in the range [0..n]) |
n |
Positive integer |
tail |
A list collected into by prepending to it |
Examples
(call/collecting (lambda (x) (* x x)) 4) ; => (0 1 4 9) (call/collecting (lambda (x) (1+ x)) 4 '(hi)) ; => (1 2 3 4 hi)
See also
Created: 2025-02-18 Di 12:58