RosettaCodeData/Task/Flatten-a-list/Icon/flatten-a-list-2.icon
2023-07-01 13:44:08 -04:00

9 lines
180 B
Text

procedure flatten(L) # in the spirt of the problem a structure
local l,x
l := []
every x := !L do
if type(x) == "list" then l |||:= flatten(x)
else put(l,x)
return l
end