Why the designers of Clojure's reverse function decided that the returned sequence isn't a lazy one?
Clojure embraces lazy sequences usually.
Surely it's because by definition, in order to reverse a sequence, you have to know what's at the other end in order to return what will become the first item in the reversed collection.
Hence, the sequence must be finite, and you'd have to evaluate it in order to use what lies at it's end.
Addendum:
Reverse doesn't make sense as an infinite sequence, (although it's fair to say that infinite sequences are not always a prerequisite for laziness).
If you are about to reverse a collection, then you already have it loaded in memory; it doesn't need to be calculated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With