|
|
|
|
|
by tmail21
3317 days ago
|
|
Looks like there is some distinction between Mutable, Read-only View and Immutable. According to this http://stackoverflow.com/questions/33727657/kotlin-and-immut... Kotlin does not support true immutability. For immutability to be practical one would need to implement structural sharing in their collections otherwise copying would be prohibitively expensive. This Java library seems to be trying to implement this. http://www.vavr.io/ Again, I am not saying that Kotlin does not support immutability, just trying to get to the bottom of the reality of it. |
|
out of curiosity, what cases will you use an immutable collection instead of a read-only? I cannot imagine any use case where immutable is a gain over read-only.