Davide Marchignoli <marchign / di.unipi.it> writes:

> Which is the rationale of the fact that block variables are non-binding
> if some variable with the same name already exists ? Isn't it confusing?

It can be confusing, but it's also a benefit. It allows blocks to be
used as closures, retaining access to local scope even if that scope
has gone out of context.

   def example
     a = 99
     return proc { |n| n + a }
   end

   x = example
   x.call(2)    # => 101


Regards


Dave