Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!news.sesqui.net!news.ti.com!ticipa!clw
From: clw@ticipa.works.ti.com (Chris Winemiller)
Subject: Re: Randomized Results
Message-ID: <1996Mar22.182411.1020@ticipa.works.ti.com>
Keywords: random results metagame game playing
Organization: None
References: <4iqqvq$lim@harbinger.cc.monash.edu.au>
Date: Fri, 22 Mar 1996 18:24:11 GMT
Lines: 26

In article <4iqqvq$lim@harbinger.cc.monash.edu.au>
dcron@bruce.cs.monash.edu.au (Danny H Cron) writes:

<snip>
>I found out previously that some Smalltalk features like sets (which use
>hashing functions) will return randomally ordered collections.  A situation
>like this could cause the problem that I have, however I am only using
>Arrays and OrderedCollections.  Are there any other things in Smalltalk,
>like Sets, which could randomize my results?

Yes, Dictionaries, though you say you're not using them.  In the case of
the OrderedCollection, you might also want to be sure that you don't
have any cases of iterating over the collection while modifying it
within the loop, something like this:

    myOrderedCollection do: [:each |
        someBooleanCondition
          ifTrue: [myOrderedCollection remove: each]
          ifFalse: ["other processing"]]

Regards,
Chris
==============================================================
Chris Winemiller               Internet: clw@works.ti.com
Disclaimer: I do not speak for TI.
==============================================================
