2 ms·
Functions like map and range return lazy lists in Clojure. This is how I'd implement zip: (def zip (partial map vector)) ;;Usage: (zip (range) [:a :b
by Reefersleep 4y ago
Functions like map and range return lazy lists in Clojure. This is how I'd implement zip:
(def zip (partial map vector))
;;Usage:
(zip (range) [:a :b :c])
;;=> ([0 :a] [1 :b] [2 :c])