The difference between Clojure and Common Lisp

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at:

Fascinating bit by Giles Bowkett. This uses recursion and is how you would do it in Common Lisp:

(defn build [list-1 list-2]
  (if (nil? list-1)
    (concat (map (fn [bubble]
                     (list (first list-1) bubble))
            (build (rest list-1) list-2))))

But Clojure is on the JVM so it does not have tail call optimization, so it can’t do that. This is Clojure way:

(defn build [seq1 seq2]
  (for [elem1 seq1 elem2 seq2] [elem1 elem2]))