4 ms·
The only language I've found / used so far that has these (expected) mechanics is Swift, which, when using a `let` for e.g. a list, will make the list itself im
by Cthulhu_ 10y ago
The only language I've found / used so far that has these (expected) mechanics is Swift, which, when using a `let` for e.g. a list, will make the list itself immutable (in addition to the reference). It's really something that is confusing in every language that has some form of 'final', be it Java (which added immutable list implementations or wrappers to their existing collections), C++, JS, or what-have-you.
- masklinn 10y ago> The only language I've found / used so far that has these (expected) mechanics is Swift Rust has similar semantics: https://is.gd/hsRjPh https://is.gd/hsRjPh versus https://is.gd/ROgzXl https://is.gd/ROgzXl IIRC you can also declare const objects in C++, but constness is more complex and overridden there.