I am reading Ruby for Rails and Ruby Cookbock and delighted by the
Array#find_all and Enumerable#collect methods. I’m wondering what the
idiomatic way to do the following is?
Two parallel arrays A, B . For each element n of A for which f(An) is
is g(B[n-3:n+3]) true? Where B[n-3:n+3] refers to seven elements of B
position is centered over An’ position.
Can the block inside Enumerable#collect know it’s position inside the
Enumerable? Can one collect two parallel arrays?
The information contained in and accompanying this communication is
confidential and intended solely for the use of the intended
If you have received it by mistake please let us know by reply and then
delete it from your system; you should not copy the message or disclose
content to anyone.
MarketAxess reserves the right to monitor the content of emails sent to
from its systems.
Any comments or statements made are not necessarily those of
For more information, please visit www.marketaxess.com. MarketAxess
Limited is regulated in the UK by the FSA, registered in England no.
4017610, registered office at 71 Fenchurch Street, London, EC3M 4BS.
Telephone (020) 7709 3100.
MarketAxess Corporation is regulated in the USA by the SEC and the NASD,
incorporated in Delaware, executive offices at 140 Broadway, New York,
10005. Telephone (1) 212 813 6000.