From: yuricake Date: 2007-05-05T13:45:06+09:00 Subject: Why do these two code blocks have different behavior? I am not a total newbie in ruby, but I am still hazy on how things like blocks, proc objects and contexts work under the covers. I have experience with Lisp lambdas, so feel free to get technical. My question is - why do the following two functions have different behavior? require "pp" @@a = [1, 2, 3] def q1 @@a.inject(0) {|sum, x| pp x return sum + x } end def q2 @@a.inject(0) {|sum, x| pp x sum + x } end