2013-04-02 13 views

Odpowiedz

14
(defn map-all [f & colls] 
    (lazy-seq 
    (when (some seq colls) 
    (cons (apply f (map first colls)) 
      (apply map-all f (map rest colls)))))) 

(map-all vector [1 2 3] [4 5]) 
;=> ([1 4] [2 5] [3 nil]) 
+0

To jest naprawdę elegancki. –

Powiązane problemy