<br><font size=2 face="sans-serif">Hallo Hans,</font>
<br>
<br><font size=2 face="sans-serif">nice to hear that your problem is solved.</font>
<br>
<br><font size=2 face="sans-serif">I rechecked my proposal and I think that I did a lot of</font>
<br><font size=2 face="sans-serif">unnecessary assignments. Every time I saw that I reached</font>
<br><font size=2 face="sans-serif">maximal recursion depth, I celebrated that event in a loop</font>
<br><font size=2 face="sans-serif">that assigned values to all elements of the tuple. That is</font>
<br><font size=2 face="sans-serif">overdoing: Every call of the method </font>
<br><font size=2 face="sans-serif">result:tupel:idx:allStreams: has the responsibility</font>
<br><font size=2 face="sans-serif">to assign to exactly one index position of the tuple to</font>
<br><font size=2 face="sans-serif">be constructed. Here is a revised version of that method</font>
<br><font size=2 face="sans-serif">that emphasizes that responsibility and avoids unneeded</font>
<br><font size=2 face="sans-serif">assignments. The gain in time is possibly not substantial,</font>
<br><font size=2 face="sans-serif">but the gain in clarity is.</font>
<br>
<br><font size=2 face="sans-serif">result: r tupel: tupel idx: myIdx allStreams: allStreams</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;&quot; &nbsp;this method is recursive. Recursion runs from values 1 to &nbsp;allStreams size &nbsp;of parameter myIdx. Each call of that method has the responsiblity to provide all possible values for one index position of the result tuples. That index position is given by the value of &nbsp;myIdx.&quot;</font>
<br>
<br><font size=2 face="sans-serif">&nbsp;[<b>tupel at: myIdx put: (allStreams at: myIdx) peek.</b></font>
<br><font size=2 face="sans-serif">&nbsp; myIdx = allStreams size</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ifTrue: [r addLast: tupel shallowCopy]</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ifFalse: &nbsp;[self &nbsp;result: r tupel: tupel idx: myIdx + 1 allStreams: allStreams].</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; (allStreams at: myIdx)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; next; &nbsp; &nbsp;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;atEnd</font>
<br><font size=2 face="sans-serif">&nbsp;] </font>
<br><font size=2 face="sans-serif">&nbsp;whileFalse: [].</font>
<br><font size=2 face="sans-serif">&nbsp;(allStreams at: myIdx) reset.</font>
<br><font size=2 face="sans-serif">&nbsp;^r</font>
<br>
<br>
<br><font size=2 face="sans-serif">Cheers again</font>
<br><font size=2 face="sans-serif">Boris Gärtner<br>
<br>
<br>
mailto: Boris_Gaertner@msg.de</font>