[Q] SequenceableCollection>>combinations: kk atATimeDo: aBlock

Ken Collins kenncoll123 at hotmail.com
Tue Dec 17 19:31:42 UTC 2002


((1 to: 12) combinations: 3 atATimeDo: [:each | Transcript cr; show: each 
printString])

Shows 220 Arrays with 3 parts each. I want to put those Arrays into a new 
OrderedCollection.

|oc|
oc_OrderedCollection new.
((1 to: 12) combinations: 3 atATimeDo: [:e | oc add:e]).
oc inspect

Also shows 220 Arrays with 3 parts each, but they are all #(12 12 12) 
instead of what shows up in the Transcript.

|oc|
oc_OrderedCollection new.
((1 to: 12) combinations: 3 atATimeDo: [:e | oc add:e printString]).
oc inspect

is more like it, but I don't want Strings, just Arrays. I don't remember 
what I need instead of printString. Or, is there some other way?

TIA,

Ken









_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail




More information about the Squeak-dev mailing list