|
  
flatten
Format: flatten( a )
Arguments: [any] a Hierarchical list or matrix
Returns: [any] Input list flattened to one level
Description: In DScript you can specify lists that
contain sublists as elements. This is the way you specify a
2-dimensional matrix, for example. The flatten primitive
combines all sublists to create a single, flat list. If the list
already contains only one dimension, it is not altered.
Examples: flatten([[1,2],[3,4]])
= [1,2,3,4]
flatten([1,2,3,4]) = [1,2,3,4]
See Also: List Literal,
group
|