3 ms·
Common Lisp version, works with an arbitrary number of lists and automatically trims the result to the length of the shortest list. (defun zip (&rest lists
by phoe-krk 4y ago
Common Lisp version, works with an arbitrary number of lists and automatically trims the result to the length of the shortest list.
(defun zip (&rest lists)
(apply #'mapcar #'list lists))
Example:
CL-USER> (zip '(1 2 3) '(4 5 6 7 8) '(a b c d))
((1 4 A) (2 5 B) (3 6 C))
- lispm 4y agoLimited by the implementation specific max number of arguments.