pNre/ExSwift — pull request #5 by zolrath (2014-06-15 03:41:07+00:00)
Title: Add partition, partitionAll, and partitionBy

I've found these functions fairly useful during my Clojure days! You said in the last pull request that it took you some hijinks to get the project to build, how is it you did that? I'm still writing my tests via copying code into another project since this won't build hah.

partition produces an array of arrays, each containing n elements, each offset by step (optional).
It also allows an optional padding array which will attempt to fill the last partition to n elements if short.

partitionAll allows the last partition to be less than n elements long without using padding elements.

partitionBy applies a condition to each element in array, splitting it each time the condition returns a new value.