|
|
|
|
|
by eternityforest
1534 days ago
|
|
It seems like the difference(As far as I can tell without spending way more time with the article) is deduplication, which other languages already give you with strings. I think thr syntax is slightly nicer than quotes, but it's also more syntax, and there is a limit to how much you can have if you don't want code to look like Perl(Which Ruby is approaching). People are saying it can can be used for some kind of better compile time checking, would be interesting to see that as the main focus? |
|
Aren't Ruby's strings mutable? I'm not sure, but I seem to recall they were/are, in which case you can't really intern them. Python and Java have immutable strings, with the ability to optimize allocations being (probably?) one of the reasons.
On the other hand, Symbols in Ruby seem to be immutable, which allows for their interning.