FLATTEN
lists
The function FLATTEN
inspects the top of the stack.
If it is a LIST of values,
it inspects each value and replaces each value which was a LIST with its content.
FLATTEN
proceed recursively until all LISTs have been flattened.
If it is not a LIST, the function exits and let the stack in the same state.
FLATTEN is available since version 1.0.0.
See also
Signatures
Examples
[
[ 'a' 'b' 'c' ]
[ 'd' 'e' [ 'f' 'g' ] ]
]
DUP
FLATTEN
[
[
{ 'L1' [ 04 [ 04 05 ] ] } //this is not a list type. recursion stops here.
]
]
DUP
FLATTEN
Examples
l = [
[ 'a', 'b', 'c' ],
[ 'd', 'e', [ 'f', 'g' ] ]
]
return l, FLATTEN(l)
l = [
[
{ 'L1':[ 04, [ 04, 05 ] ] } //this is not a list type. recursion stops here.
]
]
return l, FLATTEN(l)