9 lines
178 B
Text
9 lines
178 B
Text
|
|
procedure lcomb(L,i) #: list combinations
|
||
|
|
local j
|
||
|
|
|
||
|
|
if i < 1 then fail
|
||
|
|
suspend if i = 1 then [!L]
|
||
|
|
else [L[j := 1 to *L - i + 1]] ||| lcomb(L[j + 1:0],i - 1)
|
||
|
|
|
||
|
|
end
|