The following line:

    [5, 7].each_with_index.each_cons(2) {|v| p v }

prints [5, 7] but I'm expecting [[5, 0], [7, 1]].

Does anyone know how/why this is happening ?

thanks
-- 
Posted via http://www.ruby-forum.com/.