I'm seeing an issue where the parameter to the block overwrites a local variable with the same name. I don't know if this is simply a Ruby version issue or if it is a rubymotion bug. Anyways, I wanted to share and get your opinion. Here is an example:
def scope_test
x = 10
y = [1, 2, 3]
z = y.map { |x| x + 1 }
puts "x is now: #{x}"
[x, z]
end
I would expect this to output 10, which is indeed what I get using Ruby 2.4.4. In rubymotion I get 3.
I'm seeing an issue where the parameter to the block overwrites a local variable with the same name. I don't know if this is simply a Ruby version issue or if it is a rubymotion bug. Anyways, I wanted to share and get your opinion. Here is an example:
I would expect this to output 10, which is indeed what I get using Ruby 2.4.4. In rubymotion I get 3.
Comments on this?
/Johan