<div dir="ltr">Agree, it is faster no doubt about it.<div><br></div><div>Thank you for your change, it is on github now.</div><div><br></div><div>Cheers!</div><div>Hernan.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 25, 2019 at 5:35 PM Andres Valloud <<a href="mailto:ten@smallinteger.com">ten@smallinteger.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'd rather have the system not create an enormous amount of garbage <br>
should anyone try something like this:<br>
<br>
1 to: 30 :: combinations: 15 atATimeDo: [:x | x doSomething]<br>
<br>
If copies were being made, I'd expect the allocation / GC work to vie <br>
for execution time domination.<br>
<br>
On 5/25/19 06:05, Hernan Wilkinson via Cuis-dev wrote:<br>
> Hi Luciano,<br>
> thank you for the fix. It is integrated now and I added a couple of <br>
> tests to SequenceableCollectionTest, one when k is cero and another for <br>
> the normal case.<br>
> <br>
> When I wrote the test for the normal case I notice that the collection <br>
> passed as parameter to the block it is always the name and therefore the <br>
> following test fails:<br>
> testCombinationsAtATimeDoWorksAsExpected<br>
> <br>
> | combinations |<br>
> <br>
> combinations := OrderedCollection new.<br>
> 'abc' combinations: 2 atATimeDo: [ :combination | combinations add: <br>
> combination].<br>
> <br>
> self assert: 3 equals: combinations size.<br>
> self assert: (combinations includes: #($a $b)).<br>
> self assert: (combinations includes: #($a $c)).<br>
> self assert: (combinations includes: #($b $c)).<br>
> <br>
> To make it pass I had to make a copy of combination.<br>
> ...<br>
> 'abc' combinations: 2 atATimeDo: [ :combination | combinations add: <br>
> combination *copy*].<br>
> ....<br>
> <br>
> Is that the expected behavior? It looks weird to me... I would expect <br>
> combination to be different collections on each iteration...<br>
> <br>
> Cheers!<br>
> Hernan.<br>
> <br>
> On Thu, May 23, 2019 at 1:13 PM Luciano Notarfrancesco via Cuis-dev <br>
> <<a href="mailto:cuis-dev@lists.cuis.st" target="_blank">cuis-dev@lists.cuis.st</a> <mailto:<a href="mailto:cuis-dev@lists.cuis.st" target="_blank">cuis-dev@lists.cuis.st</a>>> wrote:<br>
> <br>
> The method was failing for the corner case of "combinations of 0<br>
> elements". Here's the fix.<br>
> -- <br>
> Cuis-dev mailing list<br>
> <a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a> <mailto:<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a>><br>
> <a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
> <br>
> <br>
> <br>
> -- <br>
> *Hernán Wilkinson<br>
> Agile Software Development, Teaching & Coaching*<br>
> *Phone: +54-011*-4893-2057<br>
> *Twitter: @HernanWilkinson*<br>
> *site: <a href="http://www.10Pines.com" rel="noreferrer" target="_blank">http://www.10Pines.com</a> <<a href="http://www.10pines.com/" rel="noreferrer" target="_blank">http://www.10pines.com/</a>>*<br>
> Address: Alem 896, Floor 6, Buenos Aires, Argentina<br>
> <br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal"><span style="font-weight:bold">Hernán Wilkinson</span><br>Agile Software Development, Teaching & Coaching</span></font></span></span></span></strong></span></div><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal">Phone: +54-011</span></font></span></span></span></strong></span><font face="tahoma, sans-serif" size="2">-4893-2057</font></div><div><strong style="font-family:tahoma,sans-serif;font-size:xx-small"><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Twitter: @HernanWilkinson</span></font></span></span></strong></div><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal">site: <a href="http://www.10pines.com/" style="color:rgb(17,65,112)" target="_blank">http://www.10Pines.com</a></span></font></span></span></span></strong></span></div><div><font face="tahoma, sans-serif"><span style="border-collapse:collapse">Address: Alem 896</span></font>, Floor 6, Buenos Aires, Argentina</div></div></div></div></div></div></div></div></div></div></div></div>