[squeak-dev] The Trunk: Collections-nice.506.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 6 22:05:58 UTC 2013


Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.506.mcz

==================== Summary ====================

Name: Collections-nice.506
Author: nice
Time: 6 March 2013, 11:05:17.838 pm
UUID: 062fc108-7bf2-452d-ba77-aa8f2175eae3
Ancestors: Collections-bf.505, Collections-nice.502

merge nice.502 (String combinations)

=============== Diff against Collections-bf.505 ===============

Item was changed:
  ----- Method: SequenceableCollection>>combinations:atATimeDo: (in category 'enumerating') -----
  combinations: kk atATimeDo: aBlock
  	"Take the items in the receiver, kk at a time, and evaluate the block for each combination.  Hand in an array of elements of self as the block argument.  Each combination only occurs once, and order of the elements does not matter.  There are (self size take: kk) combinations."
+ 	" (1 to: 5) combinations: 3 atATimeDo: [:each | Transcript cr; show: each printString]"
- 	" 'abcde' combinations: 3 atATimeDo: [:each | Transcript cr; show: each printString]"
  
  	| aCollection |
  	aCollection := Array new: kk.
  	self combinationsAt: 1 in: aCollection after: 0 do: aBlock!

Item was added:
+ ----- Method: String>>combinations:atATimeDo: (in category 'enumerating') -----
+ combinations: kk atATimeDo: aBlock
+ 	"Gather the combinations into a String rather than an Array"
+ 	
+ 	" 'abcde' combinations: 3 atATimeDo: [:each | Transcript cr; show: each printString]"
+ 
+ 	| aCollection |
+ 	aCollection := String new: kk.
+ 	self combinationsAt: 1 in: aCollection after: 0 do: aBlock!



More information about the Squeak-dev mailing list