<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-02-27 16:36 GMT+01:00 Rein, Patrick <span dir="ltr">&lt;<a href="mailto:Patrick.Rein@hpi.de" target="_blank">Patrick.Rein@hpi.de</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Oh! Cool. :)</p>
<p><br>
</p>
<p>Well then the only proposition I have is adding it to the abstract collection class as iterating over combinations is not specific to a sequenceable collection. Or am I missing something here?<br></p></div></blockquote><div><br></div><div>Yes, you are right, but current implementation rely on indexing from 1 to self size...<br></div><div>Generalization is trivial if we tolerate storing subcollections in an Array even if we iterate on a Set, <br></div><div>   ^self asArray combinations: n atATimeDo: aBlock<br></div><div style="color:rgb(33,33,33)">If we insist on storing subcollections in self species, that may require a greater effort.<br><br><hr style="display:inline-block;width:98%">
<div dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>Von:</b> <a href="mailto:squeak-dev-bounces@lists.squeakfoundation.org" target="_blank">squeak-dev-bounces@lists.squeakfoundation.org</a> &lt;<a href="mailto:squeak-dev-bounces@lists.squeakfoundation.org" target="_blank">squeak-dev-bounces@lists.squeakfoundation.org</a>&gt; im Auftrag von Nicolas Cellier &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt;<br>
<b>Gesendet:</b> Freitag, 26. Februar 2016 19:31<br>
<b>An:</b> The general-purpose Squeak developers list<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Collections-pre.679.mcz</font>
<div> </div>
</div><div><div class="h5">
<div>
<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>
</div>
</div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
</div>

<br><br>
<br></blockquote></div><br></div></div>