[Squeak] Newbie permutations

Richard A. O'Keefe ok at cs.otago.ac.nz
Tue Apr 9 23:37:12 UTC 2002


Scott Wallace <scott.wallace at squeakland.org> was 
not alone in suggesting that:
	the following naive approach works painlessly:
	
	Foo _ OrderedCollection new.
	#(1 3 5) permutationsDo: [:each | Foo add: each].
	
Well no, it doesn't.  If you try it, you get
an OrderedCollection( #(1 3 5) #(1 3 5) #(1 3 5) #(1 3 5) #(1 3 5) #(1 3 5))
which is close enough to one of the examples in Michael Grant's message to
make it obvious he'd tried something very like that.




More information about the Squeak-dev mailing list