[Pharo-dev] Bag enhancements

Stéphane Ducasse stephane.ducasse at inria.fr
Sun Aug 11 15:52:49 EDT 2013


Hi guys

I was surprised to see the API of bag for iteration.

I propose to add

keysAndValuesDo: aBlock 
	"Iterate over the receiver and apply a two argument block on the element and its occurrences."
		
	contents associationsDo: [:assoc | aBlock value: assoc key value: assoc value ]

and 

elementsAndOccurrencesDo: aTwoArgBlock 
	"Iterate over the receiver and apply a two argument block on the element and its occurrences."
	
	contents associationsDo: [:assoc | aTwoArgBlock value: assoc key value: assoc value ]

Once we agree I will add a bug entry.

Stef



More information about the Pharo-dev mailing list