9 lines
180 B
Text
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
|