Partitioned Enclose

is a dyadic function which splits its right argument into differently sized pieces as determined by the left argument.

In the simplest case, and on a vector right argument, the corresponding element in the left argument indicates where divisions begin:

Almost all dialects restrict the left argument to provide only this functionality. However, the left argument can be interpreted as a count of how many partitions begin with a particular position: Additional trailing empty divisions are thus created by adding an additional division count corresponding to the position beyond the end of the right argument: This interpretation allows a simple definition of a split-into-lengths function:

Try it online!

Tutorials

 * APL Cultivation

Documentation

 * Dyalog