Re: anyObject
Re: anyObject
- Subject: Re: anyObject
- From: Ondra Cada <email@hidden>
- Date: Thu, 31 Jan 2002 18:40:43 +0100
Robert,
>
>>>>> Robert Goldsmith (RG) wrote at Thu, 31 Jan 2002 16:52:59 +0000:
RG> >The "randomness" means there is no way to tel before which object will
RG> >be
RG> >returned, *NOT* that it would or should be a different one each time.
RG>
RG> So the docs are misleading?
Well, I've read it many times, and never I understood it the way you did, so
it does not seem misleading to me. As for "objective" misleadingness, hard
to say: had not been for your experience, I would say the docs are quite
clean and unambiguous; now it seems they, at least for some readers, are
not...
RG> Ok, then if I want to select a random object from a set, what do you
RG> suggest?
Not using a set. Set is thing whose features are "you can't select a
specific object from there" -- meant by some way of address -- "instead, you
can effectively check whether an object you know is or is not part of set".
RG> I don't need the objects to be ordered in any way.
Sorry, but saying "I want a random object" in the sense you are using it you
effectively *do* say "I want objects to be ordered" -- randomly, but that
does not change anything on the fact of ordering.
RG> Storing them
RG> in an array then using a random number to access an index seems silly
RG> when anyObject would have been such a good way to do it!
It would not, sorry. It is designed for an utterly different task (of giving
a representant).
Store them into array and select random index. Or, store them randomly into
an array and take them sequentially -- whatever suits your needs better.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
References: | |
| >Re: anyObject (From: Robert Goldsmith <email@hidden>) |