Skip to content

2.1.0: Collectors, iteration, concat varargs, each efficiency

Choose a tag to compare

@thekid thekid released this 10 May 21:55
· 294 commits to master since this release
  • Heads up: Removed sum() operation, it can easily be rewritten to
    either $sum= $seq->reduce(0, function($a, $b) { return $a + $b; })
    or $sum= $seq->collect(Collectors::summing()) which are more flexible.
    (@thekid)
  • Made functions to Collectors::summing and Collectors::averaging
    optional. If omitted, the elements themselves will be used for the
    numbers.
    (@thekid)
  • Added support for referring to instance methods via string. Depends
    on xp-framework/core#44, see pull request #17 - @thekid
  • Added Sequence::toMap() - see pull request #10 - @thekid
  • Added Sequence::iterator() - see pull request #16 - @thekid
  • Added the ability to pass a variable number of arguments to
    Sequence::concat(). At the same time, the method is changed to
    be more liberal in what it accepts. See pull request #13.
    (@thekid)
  • Implemented variant of Sequence::each() which iterates elements
    without callback and is thus more memory-efficient than calling
    e.g. toArray() and discarding the results. See pull request #12.
    (@thekid)