3 ms·
> Mutable strings by default was a huge mistake in Ruby This was changed in 3.0. String literals are now frozen/immutable by default.
by lovegoblin 5y ago
> Mutable strings by default was a huge mistake in Ruby
This was changed in 3.0. String literals are now frozen/immutable by default.
- jrochkind1 5y agoI don't believe this is correct. There was a plan to do that at some point, but it was pulled back from for backwards compat reasons. You can opt-in to string literals being frozen by default on a per-source-file basis with a magic pragma comment, and this has existed for several ruby 2.x versions and is unchanged in the released ruby 3.0.
- lovegoblin 5y agoOh, huh. Yeah, you're right. Really showed my whole still-on-2.7 ass here haha