Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn build [list-1 list-2]
  2.   (when-let [[x & xs] list-1]
  3.     (concat (map #(list x %) list-2)
  4.             (build xs list-2))))
  5.  
  6. (defn build [list-1 list-2]
  7.   (loop [result (list)
  8.          [x & xs] list-1]
  9.     (if x
  10.       (recur (concat result (map #(list x %) list-2)) xs)
  11.       result)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement