To guarantee "only the first time", I suppose you need to have some kind of synchronization at some level.
To guarantee "only the first time", I suppose you need to have some kind of synchronization at some level.
I meant that the docs do not mention thread safety.
https://clojure.org/reference/data_structures#Collections
"Seqs differ from iterators in that they are persistent and immutable, not stateful cursors into a collection. As such, they are useful for much more than foreach - functions can consume and produce seqs, they are thread safe, they can share structure etc."
https://clojure.org/reference/sequences
I think it's a fundamental enough property of clojure data structures that it would be redundant to mention it in every docstring.
(why I was in doubt, is because while immutable functional collections that clojure embaces are naturally thread-safe, there is an imperative aspect in creation of a lazy sequence from user provided function, and I was not sure clojure has to provide synchronization guarantees here)