Clamps Dictionary
call/collecting
Function
(call/collecting f n &optional (tail '()))
Call function f n times, if n is a number with idx [0..n-1] as argument, or on all elements of n if n is a list, collecting its results. Return results with tail appended.
Arguments
f |
Function of one argument (an integer in the range [0..n]) |
n |
Positive integer or a list |
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-08-17 So 16:52