Hacker News new | past | comments | ask | show | jobs | submit login

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))



Limited by the implementation specific max number of arguments.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: