may be a first step would be to have findFirst: aBlock startingAt: based
on findFirst:
findFirst: aBlock
"Return the index of my first element for which aBlock evaluates as
true."
| index |
index := 0.
[(index := index + 1) <= self size] whileTrue:
[(aBlock value: (self at: index)) ifTrue: [^index]].
^ 0
Hi
I need a collection that does the following:
col := #('a12' 'b12' 'a13' 'a14' 'c23' 'a16') asMyNewCollection.
col findFirst: [:each | each first = $a]
> a12
col findFirst: [:each | each first = $a]
> a13
Do you know a collection that would work?
So I have the impression that such behavoir could be defined with a
kind of methods wrapper.
Stef