After the second round, five more 4clojure.com solutions:

(ns com.icyrock.clojure.a4clojure_com.core (:use clojure.test)) ;;; Problem 35 - Local bindings (deftest test-problem-35 (let [v1 7 __ v1] (is (= __ (let [x 5] (+ 2 x)))) (is (= __ (let [x 3, y 10] (- y x)))) (is (= __ (let [x 21] (let [y 3] (/ x y))))))) ;;; Problem 34 - Implement range (deftest test-problem-34 (let [v1 #(take (- %2 %) (iterate inc %)) __ v1] (is (= (__ 1 4) '(1 2 3))) (is (= (__ -2 2) '(-2 -1 0 1))) (is (= (__ 5 8) '(5 6 7))))) ;;; Problem 33 - Replicate a Sequence (deftest test-problem-33 (let [v1 #(mapcat (fn [e] (repeat %2 e)) %) v2 #(apply interleave (repeat %2 %)) __ v2] (is (= (__ [1 2 3] 2) '(1 1 2 2 3 3))) (is (= (__ [:a :b] 4) '(:a :a :a :a :b :b :b :b))) (is (= (__ [4 5 6] 1) '(4 5 6))) (is (= (__ [[1 2] [3 4]] 2) '([1 2] [1 2] [3 4] [3 4]))) (is (= (__ [44 33] 2) [44 44 33 33])))) ;;; Problem 32 - Duplicate a Sequence (deftest test-problem-32 (let [v1 #(mapcat (fn [x] [x x]) %) v2 #(mapcat list % %) v3 #(interleave % %) __ v3] (is (= (__ [1 2 3]) '(1 1 2 2 3 3))) (is (= (__ [:a :a :b :b]) '(:a :a :a :a :b :b :b :b))) (is (= (__ [[1 2] [3 4]]) '([1 2] [1 2] [3 4] [3 4]))) (is (= (__ [[1 2] [3 4]]) '([1 2] [1 2] [3 4] [3 4]))))) ;;; Problem 31 - Pack a Sequence (deftest test-problem-31 (let [v1 #(partition-by identity %) __ v1] (is (= (__ [1 1 2 1 1 1 3 3]) '((1 1) (2) (1 1 1) (3 3)))) (is (= (__ [:a :a :b :b :c]) '((:a :a) (:b :b) (:c)))) (is (= (__ [[1 2] [1 2] [3 4]]) '(([1 2] [1 2]) ([3 4])))))) (run-tests)