Namespaces

 
1.0.0-SNAPSHOT permalink Arrow_down_16x16

flatten-nodes-coll

net.cgrand.enlive-html

  • (flatten-nodes-coll x)

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source net/cgrand/enlive_html.clj:211 top

(defn flatten-nodes-coll [x]
  (letfn [(flat* [x stack]
            (if (node? x) 
              (cons x (when (seq stack) (flat (peek stack) (pop stack))))
              (if-let [[x & xs] (seq x)]
                (recur x (conj stack xs))
                (when (seq stack)
                  (recur (peek stack) (pop stack))))))
          (flat [x stack]
            (lazy-seq (flat* x stack)))]
    (flat x ())))
Vars in net.cgrand.enlive-html/flatten-nodes-coll: defn letfn
Used in 0 other vars

Comments top

No comments for flatten-nodes-coll. Log in to add a comment.