From: Todd Benson Date: 2011-03-03T11:15:44+09:00 Subject: What is inject doing here? Why does this not do what I expect? irb(main):001:0> RUBY_VERSION => "1.9.2" irb(main):002:0> (0..3).inject {|s, i| a = i%2 == 0 ? 1 : -1; p a} -1 1 -1 => -1 I would think the result should be 1 -1 1 -1 => -1 Todd