|
fcn comb(k,seq){ // no repeats, seq is finite
|
|
seq=seq.makeReadOnly(); // because I append to parts of seq
|
|
fcn(k,seq){
|
|
if(k<=0) return(T(T));
|
|
if(not seq) return(T);
|
|
self.fcn(k-1,seq[1,*]).pump(List,seq[0,1].extend)
|
|
.extend(self.fcn(k,seq[1,*]));
|
|
}(k,seq);
|
|
}
|