[Pkg] The Trunk: Collections-dtl.437.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Apr 7 00:24:00 UTC 2011
David T. Lewis uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-dtl.437.mcz
==================== Summary ====================
Name: Collections-dtl.437
Author: dtl
Time: 6 April 2011, 8:23:37.222 pm
UUID: c1d30608-bcc0-4bb7-205a-2af7a46c1508
Ancestors: Collections-ul.436
Projects reloaded from disk should not repeat previous random sequences for #atRandom.
Discussion:
http://lists.squeakfoundation.org/pipermail/beginners/2011-April/007679.html
Add class Collection to the startUp list. Re-seed the generator as per Etoys practice but use existing Random>>initialize to provide the seed.
=============== Diff against Collections-ul.436 ===============
Item was changed:
----- Method: Collection class>>initialize (in category 'class initialization') -----
initialize
"Set up a Random number generator to be used by atRandom when the
user does not feel like creating his own Random generator."
RandomForPicking := Random new.
+ MutexForPicking := Semaphore forMutualExclusion.
+ Smalltalk addToStartUpList: self!
- MutexForPicking := Semaphore forMutualExclusion!
Item was added:
+ ----- Method: Collection class>>startUp (in category 'system startup') -----
+ startUp
+ "Reseed the random generator at startup time such that a reloaded
+ project will not repeat a previous pseudo-random sequence when
+ selecting at random from a collection."
+
+ MutexForPicking
+ critical: [RandomForPicking initialize]!
More information about the Packages
mailing list