chickadee » ck-macros » c-utake

(c-utake L U) → listsyntax

Yields a list containing up to U items from the front of the given list, where U is a unary number.

Analogous to take from SRFI 1, but uses unary numbers, and yields the entire list if it is too short.

(ck () (c-quote (c-utake '(a b c d) '(x y z))))
;; ==> '(a b c)
(ck () (c-quote (c-utake '(a b) '(x y z))))
;; ==> '(a b)