RosettaCodeData/Task/Flatten-a-list/Icon/flatten-a-list-2.icon
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07: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