The first thing I thought of was:

| anArray |
anArray := #(#Object #subclass: #Point #instanceVariableNames: 'x y'
#classVariableNames: '' #package: 'Kernel-BasicObjects').

(1 to: anArray size by: 2) collect: [:i | anArray at: i]

All the best,

Ron Teitelbaum

On Thu, Apr 20, 2017 at 2:04 AM Alistair Grant <akgrant0...@gmail.com>
wrote:

> On Thu, Apr 20, 2017 at 12:17:35AM +0300, Yuriy Tymchuk wrote:
> > I second the Peter???s idea. I don???t think that we need a dedicated
> index-based select when we already have withIndex*. Also one year after
> adding withIndexSelect: we can mine public repos and see how many projects
> use the method and the selection block does not read the first (each)
> parameter.
> >
> > Uko
> >
> > > On 20 Apr 2017, at 00:07, Peter Uhnak <i.uh...@gmail.com> wrote:
> > >
> > > We already have
> > >
> > > * #withIndexCollect:
> > > * #withIndexDo:
> > >
> > >
> > > So why not #withIndexSelect: ?
> > >
> > > #(#Object #subclass: #Point #instanceVariableNames:) withIndexSelect:
> [ :each :i | i \\ 2 = 0 ]
> > >
> > > Peter
>
> +1
>
>
>
>

Reply via email to