Re:Ruby 3.4 Frozen String Literals: What Rails Developers Ne...
by hinkley on Wednesday July 09, 2025 @12:56PM
(#44512308)
Here’s a more concrete example:
You make an arrow function that takes an object as input, and calls another with a string and a field from the object, for instance to populate a lookup table. You probably don’t want someone changing map keys out from under you, because you’ll break resize. So copies are being made to ensure this?
With immutable strings literals, string literals can be reused.