I read recently a flaw I did not previously know about...
"Blocks (closures) in Ruby do not introduce a new scope, only methods
do.
This is generally acknowledged as a flaw by the Ruby community but is
left
in for backwards compatibility. For example:
x = 0
[1,2,3].each{|x| print x}
#x now equals 3"
Of course this is just wrong. I am hoping no one expects an
implementation of Ruby to actually behave this way.
Is it generally accepted that programs should not expect this? I would
not be ashamed to break this code in a new implementation of Ruby.
-Patrick