a = 1 a += 1 => 2
原始对象1现在未使用,这不是很有表现力。为什么整数在 ruby 中是不可变的?我看过stackoverflow,但找不到任何解释。
1
ruby integer immutability
immutability ×1
integer ×1
ruby ×1