• (rec-seq binding-name & body)
Similar to lazy-seq but binds the resulting seq to the supplied
binding-name, allowing for recursive expressions.

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 clojure/contrib/seq.clj:101 top

(defmacro rec-seq 
 "Similar to lazy-seq but binds the resulting seq to the supplied 
  binding-name, allowing for recursive expressions."
 [binding-name & body]
  `(let [s# (atom nil)]
     (reset! s# (lazy-seq (let [~binding-name @s#] ~@body)))))
Vars in clojure.contrib.seq/rec-seq: defmacro apply atom concat deref lazy-seq let list reset! seq vector
Used in 0 other vars

Comments top

No comments for rec-seq. Log in to add a comment.