Mouseover to repel nodes. Weee, nodes!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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)))))) |