[Pharo-users] index of element matching block

Pablo Estefó pestefo at gmail.com
Tue Mar 4 09:45:41 EST 2014


On Feb 12, 2014, at 12:03, btc at openinworld.com wrote:

> Norbert Hartl wrote:
>> 
>> Am 12.02.2014 um 11:44 schrieb Sven Van Caekenberghe <sven at stfx.eu>:
>> 
>>   
>>> #( 11 7 4 21 ) detectIndex: #even
>>> 
>>>     
>> I knew it makes sense to ask. Only slightly embarrasing :)
>>   
> Thanks for asking. I learnt something new.

+1

Thanks!

> cheers -ben
>> Norbert
>> 
>>   
>>> ;-)
>>> 
>>> On 12 Feb 2014, at 12:37, Norbert Hartl <norbert at hartl.name> wrote:
>>> 
>>>     
>>>> I just discovered that there is no method like
>>>> 
>>>> indexOf: aBlock
>>>> 
>>>> where the index of the element matching the block is returned. What would be the usual way to achieve this functionality?
>>>> 
>>>> Norbert
>>>> 
>>>> 
>>>>       
>>>     
>> 
>> 
>> 
>>   
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20140304/d9a98b0a/attachment.html>


More information about the Pharo-users mailing list