> I don't think I like the notion of a lazy-seq and an iterator, since reading > the iterator also changes it. Consider the case where you create a lazy-seq > from an iterator, and the iterator somehow escapes. Somewhere else the > iterator is read from, and now the data that where supposed to be in the > lazy-seq no longer exists. > > I guess you could clone the iterator, but that would sort of remove the > purpose of using a lazy-seq in the first place. > > Jonathan
The same argument could apply to every other kind of lazy seq: * resultset-seq better not let the ResultSet escape * seqs over arrays better not let the array escape * line-seq better not let the BufferedReader escape and so on. Implementers of seqs are responsible for encapsulating implementation details and not letting them escape. It's a fact of life. Stu Stuart Halloway Clojure/core http://clojure.com -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en