ClojureCLR v2.6 Release Notes

  • Several important Clojure functions now return sequences that also contain fast reduce() (or in some cases iterator()) paths. In many cases, the new implementations are also faster for lazy sequences

    • repeat - now implements IReduce
    • cycle - implements IReduceInit
    • iterate - implements IReduceInit
    • range - implements IReduce, specialized case handles common case of all longs
    • keys - iterates directly over the keys of a map, without seq or MapEntry allocation
    • vals - iterates directly over the vals of a map, without seq or MapEntry allocation
    • iterator-seq - creates a chunked sequence when previously it was unchunked

    ➕ Additionally, hash-maps and hash-sets now provide iterators that walk the data structure directly rather than via a sequence.

    A new interface (IMapIterable) for direct key and val iterators on maps was added. External data structures can use this interface to provide direct key and val iterators via keys and vals.

    These enhancements are particularly effective when used in tandem with transducers via transduce, sequence, into, and eduction.