Collection atRandom:

Frank Shearar frank.shearar at rnid.org.uk
Fri Nov 21 13:50:12 UTC 2003


Ah, my apologies. 3.7alpha #5548. #atRandom: has been around since
2001/09/04, from what I can tell from its versions in my image.

Still, my question's meant to be more general than just this particular
case. Wouldn't it be better to implement a message that is intended to be
refined by subclasses, even if it just consisted of "^ self
subclassResponsibility", rather than trusting subclasses to implement it?
That way you'd get a more directed message "My subclass should have
overridden #atRandom:" rather than a slightly misleading (I think) Message
Not Understood.

frank

"ducasse" <ducasse at iam.unibe.ch> wrote in message
news:DF6D9FB0-1C25-11D8-A29B-000A9573EAE2 at iam.unibe.ch...
> which version are you referring...
>
> Stef
>
>
> On Vendredi, nov 21, 2003, at 14:09 Europe/Zurich, Frank Shearar wrote:
>
> > Why is it that Collection>>random (is this the correct syntax?) calls
> > #atRandom: yet Collection doesn't implement this message?
> >
> > I would have thought you'd want to do something like
> >
> > Collection atRandom: aGenerator
> > ^ self subclassResponsibility
> >
> > frank
> >
> >
> >
>
>
>






More information about the Squeak-dev mailing list