3 ms·
I think this is really what it comes down to in Nim. I personally prefer immutable strings, but I don't think it would be wise to force them to always be immuta
by bunderbunder 8y ago
I think this is really what it comes down to in Nim. I personally prefer immutable strings, but I don't think it would be wise to force them to always be immutable in Nim, because then you'd have this weird language wart where
let foo = someValue
var bar = someOtherValue
yields an immutable foo and a mutable bar for all types except strings.
I'm guessing that's a detail that's lost on folks who haven't spent much time with Nim, because the way mutability and immutability work in Nim is different from how it works in any mainstream language.
- atilaneves 8y agoI don't know a lot about Nim, but I do know D, and there `string` is just an alias to `immutable(char)[]`. String literals are of this type. But one can manipulate mutable arrays of char all day long if needed.