The reason is that x would be referring to a number like 1, 42, or whatever, and numbers are immutable in Ruby. You can't "change" a number in-place. If you could change Ruby's concept of 1 into 2, then 1 would cease to exist and that would be a Bad Thing™ :-)
The reason is that x would be referring to a number like 1, 42, or whatever, and numbers are immutable in Ruby. You can't "change" a number in-place. If you could change Ruby's concept of 1 into 2, then 1 would cease to exist and that would be a Bad Thing™ :-)