<div dir="ltr">But this already exist, at least for SequenceableCollection, try:<br><br>(1 to: 4) combinations: 2 atATimeDo: [:e | Transcript cr; show: e printString] <br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-26 16:05 GMT+01:00  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A new version of Collections was added to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Collections-pre.679.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/Collections-pre.679.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-pre.679<br>
Author: pre<br>
Time: 26 February 2016, 4:04:56.205127 pm<br>
UUID: 2ac5821c-d6f5-418c-ab07-ed3c2b9de62c<br>
Ancestors: Collections-eem.678<br>
<br>
This is a new iteration method which allows the iteration over asymmetric pairs. I have found this useful in game collision detections or duplicate detections. Alternatively we might want to take a second collection as input and create asymmetric pairs from self and this second collection.<br>
<br>
=============== Diff against Collections-eem.678 ===============<br>
<br>
Item was added:<br>
+ ----- Method: Collection&gt;&gt;asymmetricPairsDo: (in category &#39;accessing&#39;) -----<br>
+ asymmetricPairsDo: aBlock<br>
+<br>
+       | iterationCollection currentElement |<br>
+       iterationCollection := self copy.<br>
+<br>
+       [currentElement := iterationCollection anyOne.<br>
+       iterationCollection remove: currentElement.<br>
+       iterationCollection isEmpty not]<br>
+               whileTrue: [ iterationCollection<br>
+                       do: [:element | aBlock value: currentElement value: element]].!<br>
<br>
<br>
</blockquote></div><br></div>