(let [gross (reify Object (equals [_ x] true)) f #(if (identical? % gross) [gross gross gross] gross) g (constantly gross) h (constantly gross) x 5/19] (= ((comp f g h) x) ((juxt f g h) x) [x x x]))
false
(let [listInput [{:paths [[{:node 1} {:cost 1}] [{:node 2} {:cost 2}]]} {:paths [[{:node 2} {:cost 1}] [{:node 3} {:cost 2}]]} {:paths [[{:node 0} {:cost 1}] [{:node 1} {:cost 2}]]}]] (print (:node (nth (:paths (nth listInput 1)) 0))))
nil
"nil"
(persistent! (let [g {"a" {:b [1 2 3], :c [4 5]}, "d" {:b [2 3], :e [5 6 7]}}] (reduce (fn [m [k2 k1 v]] (assoc! m k2 (assoc (m k2 {}) k1 v))) (transient {}) (for [[k1 m] g [k2 v] m] [k2 k1 v]))))
{:b {"a" [1 2 3], "d" [2 3]}, :c {"a" [4 5]}, :e {"d" [5 6 7]}}
(let [fib-seed (fn [a b] (fn fib ([n] (fib n a b)) ([n f1 f2] (if (= n 1) f1 (recur (dec n) f2 (+ f1 f2)))))) fib-1-1 (fib-seed 1 1) fib-10-10 (fib-seed 10 10)] [(/ (float (fib-1-1 10)) (fib-1-1 9)) (/ (float (fib-10-10 10)) (fib-10-10 9))])
[1.6176470588235294 1.6176470588235294]
(let [fib-seed (fn [a b] (fn fib ([n] (fib n a b)) ([n f1 f2] (if (= n 1) f1 (recur (dec n) f2 (+ f1 f2)))))) fib-1-1 (fib-seed 1 1) fib-10-10 (fib-seed 10 10)] [(/ (float (fib-1-1 20)) (fib-1-1 19)) (/ (float (fib-10-10 20)) (fib-10-10 19))])
[1.6180339631667064 1.6180339631667064]
(let [❄ inc ☃ 1] (-> ☃ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄ ❄))
42
(let [g [1 5 3 3 2 4 5 5 4 5 1 2 1 2 3 5] [v x c] (reduce (fn [[v x c] y] (if (= x y) [v x (inc c)] [(conj v [x c]) y 1])) [[] (first g) 1] (rest g))] (conj v [x c]))
[[1 1] [5 1] [3 2] [2 1] [4 1] [5 2] [4 1] [5 1] [1 1] [2 1] [1 1] [2 1] [3 1] [5 1]]
(let [g [1 5 3 3 2 4 5 5 4 5 1 2 1 2 3 5] gs (sort g) [v x c] (reduce (fn [[v x c] y] (if (= x y) [v x (inc c)] [(conj v [x c]) y 1])) [[] (first gs) 1] (rest gs))] (conj v [x c]))
[[1 3] [2 3] [3 3] [4 2] [5 5]]
((fn [ks ls] (let [lsets (map set ls)] (reduce (fn [m v] (assoc m v (filter #(contains? (set %) v) ls))) {} ks))) [0 2 6 8] '((0 1 2) (3 4 5) (6 7 8) (0 3 6) (1 4 7) (2 5 8) (0 4 8) (2 4 6)))
{0 ((0 1 2) (0 3 6) (0 4 8)), 2 ((0 1 2) (2 5 8) (2 4 6)), 6 ((6 7 8) (0 3 6) (2 4 6)), 8 ((6 7 8) (2 5 8) (0 4 8))}
(defn make-name [] (let [namespaces (all-ns) namespace (->> namespaces (mapcat #(clojure.string/split (name (.name %)) #"[.-]")) shuffle (take (+ 2 (rand-int 4))) (clojure.string/join ".")) variable (->> namespaces (mapcat ns-publics) (mapcat #(clojure.string/split (name (key %)) #"[-*!?]")) shuffle (remove empty?) (take (+ 2 (rand-int 3))) (clojure.string/join "-"))] (symbol (str namespace \/ variable))))
#'user/make-name
(let [a [[36 116 105 109 [101 114 32 49 [54 58 48 58 [48 32 44 40 [108 101 116 32 [91 119 104 97 [116 39 115 32 [39 116 104 105 [115 63 32 97 32]]]]]]]]] "] (println (apply str (apply str (map char (flatten (a 0)))) a (a 1))))"]] (println (apply str (apply str (map char (flatten (a 0)))) a (a 1))))
nil
"$timer 16:0:0 ,(let [what's 'this? a [[36 116 105 109 [101 114 32 49 [54 58 48 58 [48 32 44 40 [108 101 116 32 [91 119 104 97 [116 39 115 32 [39 116 104 105 [115 63 32 97 32]]]]]]]]] \"] (println (apply str (apply str (map char (flatten (a 0)))) a (a 1))))\"]] (println (apply str (apply str (map char (flatten (a 0)))) a (a 1))))\n"
(let [what's 'this? a [[36 116 105 109 [101 114 32 49 [54 58 48 58 [48 32 44 40 [108 101 116 32 [91 119 104 97 [116 39 115 32 [39 116 104 105 [115 63 32 97 32]]]]]]]]] "] (println (apply str (apply str (map char (flatten (a 0)))) a (a 1))))"]] (println (apply str (apply str (map char (flatten (a 0)))) a (a 1))))
nil
"$timer 16:0:0 ,(let [what's 'this? a [[36 116 105 109 [101 114 32 49 [54 58 48 58 [48 32 44 40 [108 101 116 32 [91 119 104 97 [116 39 115 32 [39 116 104 105 [115 63 32 97 32]]]]]]]]] \"] (println (apply str (apply str (map char (flatten (a 0)))) a (a 1))))\"]] (println (apply str (apply str (map char (flatten (a 0)))) a (a 1))))\n"