How to return array keys into another array

Tim Rowledge tim at
Thu Jun 10 19:16:07 UTC 2004

Avi Bryant <avi at> wrote:

> > How about
> > a2 := a select:[:i| i = 'free]
> No, because he wanted the indices, not the actual values.
D'h. Missed the key bit.
 However, I
> suspect this isn't the whole story; it's unusual enough to deal with 
> array indices directly that I wonder what the final goal is here, and 
> whether there might be some better way of achieving it...
It's pretty unlikely that a sensible design would need the indices.

Tell us more about the problem - this is probably a good learning

Tim Rowledge, tim at,
Useful random insult:- Answers the door when the phone rings.

More information about the Squeak-dev mailing list