Using the APL System Function Partition Enclosure in METSIM

The APL+Win System Function "Partition Enclose" uses a boolean vector as a pattern to partition and enclose another vector.

The length of the boolean vector must match the length of the vector to be partitioned. Each 1 starts a partition for enclosure, and each following zero includes the mapped characters in the current partition for enclosure.

System Functions start with the APL character "Quad" (which looks like the square of a computer monitor) and is available with the "Alt + L" key combination.  Note I have used the capital L so it is recognisable as an "ell" and not a capital i.

The "quad penclose" system function name is the abbreviation for Partition Enclose.  But APL is not case sensitive with system functions, so I prefer think of it as "quad pEnclose" so it is easier to see that it is about enclosing, not about pens.

The function uses a boolean partition vector which is a bit like a map of where to cut to to make "words" out of a string of characters. It is maybe like the cutting function on one of those things for printing and cutting stick on text labels (Dymo?). The boolean 1's and 0's are the "Cut" and "Don't cut" command.  So as you make a label (an enclosed item of numerous text characters)  you combine characters by separating them with cuts.

1 0 1 0 0 1 0 0 "quad pEnclose" 'It is so' returns 'It ' 'is ' 'so'

Note there are still spaces in the chopped up words.  A "Delete Extraneous Blanks" function would be good.

1 0 0 1 0 0 1 1 1 "quad pEnclose"  1 2 3 4 5 6 7 8 9   returns   1 2 3    4 5 6    7   8   9 or (1 2 3) (4 5 6)  7  8  9