3 ms·
TIL that the Clojure rationale doesn't mention or motivate lazy sequences which are all over the place in Clojure. That laziness (in collection APIs, duh) was a
by Mesopropithecus 3y ago
TIL that the Clojure rationale doesn't mention or motivate lazy sequences which are all over the place in Clojure.
That laziness (in collection APIs, duh) was a major reason that I stopped using the language more after 1 or 2 years of toying around. Maybe that concept was too foreign for me, but objectively lazy seqs don't compose with other language features like dynamic scoping.
Yet I'm happy I tried it, learned a bunch of stuff along the way.
- jwr 3y agoThey have their uses — I went through a similar process as you did, and these days I take care to realize lazy sequences in most places (for example using `into` or `mapv` instead of map), mostly to get localized exceptions in case they happen. But I am also very happy to have lazy sequences when I need them (transducer pipelines with data that doesn't fit in memory). When you need them, you need them :-)
- Mesopropithecus 3y agoOh absolutely - my critizism is about the decision to make them lazy by default.