From: Robert Feldt Date: 2001-03-05T17:05:30+09:00 Subject: [ruby-talk:11999] PLS-violation in proc as block method invocation!? Hi, I guess the following behavior is due to block/proc conversions in method invocation but IMHO we should work to avoid it since it violates PLS (Principle of Least Surprise) and have practical drawbacks (I have a memoizer (caching results based on parameters) which should be able to detect when called with the same block/proc): $blocks = [] def m(&b) $blocks.push b end m {|i| i} m {|i| i} puts $blocks[0] == $blocks[1] # => false. Have to live with it, I guess... p = proc{|i| i} m(&p) m(&p) puts $blocks.inspect puts $blocks[2] == $blocks[3] # => false. IMHO not "correct". IMHO, the last statement should evaluate/print true and not false. Or have I forgot some issue? Detailed explanations of what's happening? /Robert Ps. $ ruby -v proc.rb ruby 1.7.0 (2001-01-23) [i686-cygwin] false [#, #, #, #] false