M
Mike Meyer
Paul Rubin said:What is the use case for immutable strings? Why shouldn't strings be
mutable like they are in Scheme?
I don't know. Why shouldn't they?
Generally if I know I don't plan to mutate something, I'd want to make
it immutable so the runtime system can notice if I make an error.
It's like an "assert" statement spread through the whole program.
That's not a use case, that's a debugging aid. The same logic applies
to adding type declarations, private/public/etc. declerations, and
similar B&D language features. It's generally considered that it's not
a good enough reason for adding those, so it doesn't really constitute
a good enough reason for making an instance immutable.
<mike