3 ms·
> Ruby always returns a value and does not change structures in place The not changing structures in place bit is only for std library things… nothing is stopp
by cortesoft 4y ago
> Ruby always returns a value and does not change structures in place
The not changing structures in place bit is only for std library things… nothing is stopping code you write from modifying structures in place.
Ruby has the ‘! means it mutates’ convention as well, and the built in methods use it (for example, .sort! on an array modifies the array in place just like your Scheme example). However, again it is just a convention… nothing stops a ruby developer from modifying something in place without a !, or making a method that ends in ! that doesn’t modify in place.
The common theme in Ruby is ‘nothing stops you from…’