Skip to content

Instantly share code, notes, and snippets.

@tgk
tgk / README.md
Last active Dec 18, 2015 — forked from mbostock/.block
Test of gist viewer
View README.md

Mouseover to repel nodes. Weee, nodes!

View converging.clj
(defn converging-seq
[coll]
(for [[x y] (partition 2 1 (cons ::not-an-element coll)) :while (not (= x y))] y))
(defn converging-seq2
[[x y & tl]]
(cond (nil? x) []
(nil? y) [x]
(= x y) [x]
:else (lazy-seq (cons x (converging-seq2 (cons y tl))))))