Skip to content

Instantly share code, notes, and snippets.

@tgk
tgk / README.md
Last active December 18, 2015 07:09 — forked from mbostock/.block
Test of gist viewer

Mouseover to repel nodes. Weee, nodes!

(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))))))