the real immutability support would be great. i really like that in swift
💯 7
e
elizarov
04/07/2017, 3:14 PM
Can you elaborate, please? Some Swift example would be really appreciated.
c
codeslubber
04/07/2017, 4:03 PM
In Swift, you can make a class or a struct. The struct is always by value, class by reference.
e
elizarov
04/07/2017, 4:30 PM
So, does it mean you are really looking for value types?
k
kevinmost
04/07/2017, 6:26 PM
I'm not really sure what the "real immutability support" proposal would even entail in Kotlin, or how it would interop with Java, or anything else, but I voted for it because it's an amazing feature if we could have interior immutability.
Rust has interior immutability where you have to pass a mutable reference to be able to do things like push elements into a Vec, while you can use any reference to read an element from it.
Again, I question the feasibility of something like that, but it's definitely item #1 on my wishlist
➕ 1
c
christophsturm
04/18/2017, 6:56 PM
sorry guys i totally missed this thread, here’s an explanation with a probably outdated syntax, but you get the idea http://stackoverflow.com/a/28535589