Jan. 8, 2012
3:16 p.m.
This may just be me misunderstanding the way it's supposed to work, but I was exploring the method combinations: kk atATimeDo: aBlock defined in SequenceableCollection 'abcde' combinations: 2 atATimeDo: [:each | Transcript cr; show: each printString]. produces the expected result: #($a $b) #($a $c) #($a $d) #($a $e) #($b $c) #($b $d) #($b $e) #($c $d) #($c $e) #($d $e) but, if you add :each to a collection instead of printing, you get something different. The following code: res := OrderedCollection new. 'abcde' combinations: 2 atATimeDo: [:each | res add: each]. Transcript show: res. produces: an OrderedCollection(#($e $e) #($e $e) #($e $e) #($e $e) #($e $e) #($e $e) #($e $e) #($e $e) #($e $e) #($e $e)) Thanks again.