list.separate
Syntax
- l := list.separate(a,isize...)
Separates an iterable type (list, matrix, array, string, etc) into a list of lists. For example, an object with 12 elements can be separated into a list of 4 entries, each entry a list of size 3. This can be repeated to an arbitrary nesting depth by giving repeated sizes as arguments, with the lowest (most nested) size coming last.
For example the function:
l = list.range(1,12) l = list.separate(l,4)
will result in l being a 3 element long list of lists of size 4, so l(1) = {1,2,3,4) and l(2) = {5,6,7,8}.
Was this helpful? ... | Itasca Software © 2024, Itasca | Updated: Sep 26, 2024 |