3 ms·
JEP 431: Sequenced Collections feels like it is inspired by Clojure's Seq interface / abstraction: https://clojure.org/reference/sequences https://clojure.org/
by thesuperbigfrog 4y ago
JEP 431: Sequenced Collections feels like it is inspired by Clojure's Seq interface / abstraction:
https://clojure.org/reference/sequences https://clojure.org/reference/sequences
Sequenced Collections: "Introduce new interfaces to represent collections with a defined encounter order. Each such collection has a well-defined first element, second element, and so forth, up to the last element. It also provides uniform APIs for accessing its first and last elements, and for processing its elements in reverse order."
Clojure Seq: "Clojure uses the ISeq interface to allow many data structures to provide access to their elements as sequences. The seq function yields an implementation of ISeq appropriate to the collection. 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."
- pjmlp 4y agoOr Smalltalk collections, or Lisp streams, or ML sequences,... These ideas are quite old, the main issue has been the decades that have taken to finally reach mainstream.