On Fri, Apr 21, 2017 at 1:55 PM, Alistair Grant <[email protected]>
wrote:

> On Fri, Apr 21, 2017 at 09:05:15AM +0800, Ben Coman wrote:
> > On Fri, Apr 21, 2017 at 12:31 AM, Nicolas Cellier
> > <[email protected]> wrote:
> > >
> > > On the other hand, we have #keysAndValuesDo: which competes with
> > > #withIndexDo: and is a bit more portable across dialects
> > > (it's just that it turns the bloc parameters the other way around,
> [:index
> > > :element | ])
> > >
> > > So maybe this should have been #keysAndValuesSelect:
> #keysAndValuesCollect:
> > >
> > > Reminder, keys does not mean Dictionary, in an IndexedCollection (or
> maybe a
> > > SequenceableCollection) the keys are indices. Or the other way around,
> a
> > > Dictionary is indexed by arbitrary keys (not just positive integers).
> >
> > Sounds like something I should know, but I'm not quite getting it.
> > Could you provide an example?
>
> Is this what you meant?
>
>
> | results |
>
> results := OrderedCollection new.
> #('a' 'b' 'c' 'd') keysAndValuesDo:
>         [ :k :v | results add: { k. v. } ].
> results
>
>
I thought you meant "something" else and wasn't sure what.
That clears it up. thx.
cheers -ben

Reply via email to